TThe TextSolutions
Developer Tools·5 min read·June 13, 2026

URL Encoding Explained: How to Encode and Decode URLs Online

Learn what URL encoding is and how to encode or decode URLs online for free. Understand percent-encoding, encodeURIComponent vs encodeURI, and when to use each.

Free Online Tool

URL Encoder/Decoder

Try it Free →

URLs can only contain a limited set of characters. When you need to put a space, an ampersand, a question mark, or a non-English character into a web address, it has to be URL encoded first — otherwise the link breaks or behaves unexpectedly. Our free URL encoder and decoder converts text to and from percent-encoded format instantly in your browser.

What Is URL Encoding?

URL encoding, also called percent-encoding, replaces unsafe or reserved characters in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and a question mark becomes %3F.

This is necessary because certain characters have special meaning in a URL. A ? separates the path from the query string, a & separates query parameters, and an = assigns a value. If those characters appear inside a value, they must be encoded so the browser does not misinterpret the address. URL encoding is closely related to other schemes like Base64 and HTML entity encoding, which solve the same problem in different contexts.

How to Encode and Decode a URL Online

  1. Choose Encode or Decode.
  2. Paste your text or URL into the input box.
  3. Pick the encoding mode — component or full URL (explained below).
  4. Copy the result with one click.

Everything runs locally in your browser, so even private links stay on your device.

encodeURIComponent vs encodeURI

There are two common ways to encode a URL, and choosing the right one matters:

Component Encoding (encodeURIComponent)

This encodes all special characters, including /, ?, &, =, and +. Use it when encoding a single piece of a URL — such as a query parameter value — where those characters should be treated as literal text rather than URL structure.

Full URL Encoding (encodeURI)

This preserves the characters that make up a valid URL structure — like :, /, ?, and # — and only encodes genuinely unsafe characters. Use it when encoding a complete URL that should remain functional.

As a rule: use component encoding for values you are inserting into a URL, and full URL encoding for an entire address.

Common Uses for URL Encoding

Query parameters — Safely pass search terms, email addresses, or any text containing special characters in a URL.

API requests — Many APIs require parameters to be percent-encoded before they are sent.

Sharing links — Encode URLs that contain spaces or non-ASCII characters so they work reliably when pasted into messages or emails.

Debugging — Decode an encoded URL to read exactly what it contains and spot mistakes.

Frequently Asked Questions

Is the URL encoder free? Yes — it is free, requires no sign-up, and runs entirely in your browser.

What does %20 mean? %20 is the URL-encoded representation of a space character. Percent-encoding replaces each unsafe character with % followed by its hexadecimal code.

What is the difference between encodeURI and encodeURIComponent? encodeURIComponent encodes all reserved characters and is meant for individual URL parts like parameter values. encodeURI preserves URL-structure characters and is meant for a complete address.

Is my data sent to a server? No. All encoding and decoding happens locally in your browser.

Need to fix a broken link or build a safe query string? Paste your text and encode or decode it in seconds.

Related Guides

Ready to try it?

URL Encoder/Decoder — Free & Browser-Based

Open URL Encoder/Decoder