🛠️ Web & Developer

URL Encoder / Decoder

Encode text into URL-safe percent-encoding, or decode encoded URLs back to readable text. Supports component and full-URL modes, with live conversion.

Advertisement
🔗
URL Encoder & Decoder

Convert text and URLs to and from percent-encoding. Choose encode or decode, pick the encoding scope, and the result updates instantly. Everything runs in your browser.

Text to Encode
Encoded Result
Advertisement

What is a URL Encoder?

A URL encoder (or percent-encoder) converts characters that aren't allowed in a web address into a safe format that browsers and servers can transmit correctly. URLs can only contain a limited set of characters, so spaces, accented letters, symbols, and many punctuation marks must be "percent-encoded" — replaced with a % sign followed by their hexadecimal code. This tool encodes text into URL-safe form and decodes encoded URLs back into readable text, in both directions, instantly.

It's an everyday utility for web developers, who constantly work with query strings, form data, API requests, and links containing special characters. Encoding ensures that data passed in a URL arrives intact, without breaking the address or being misinterpreted.

How Does URL Encoding Work?

Each character that isn't permitted in a URL is replaced by a percent sign followed by the two-digit hexadecimal value of its byte. Spaces, for example, become %20. Characters outside basic ASCII (like accented letters or emoji) are first encoded as their UTF-8 bytes, each then percent-encoded.

Unsafe character → % + hex byte value

space → %20
& → %26
? → %3F
= → %3D
é → %C3%A9 (two UTF-8 bytes)

"a b&c" → "a%20b%26c"

How to Use This URL Encoder

Choose Encode to convert text into percent-encoding, or Decode to convert an encoded URL back to readable text. When encoding, pick the scope: "Component" encodes every special character (best for query-string values and form data), while "Full URL" preserves the structural characters like : / ? & = so a whole URL stays valid. Type or paste your text and the result appears instantly — copy it with one click.

Component vs Full-URL Encoding

This distinction matters. Component encoding (encodeURIComponent) encodes everything that isn't a basic letter, digit, or a few safe symbols — including / ? & = — which is exactly what you want for a single value going into a query string, because those characters would otherwise be misread as URL structure. Full-URL encoding (encodeURI) leaves the structural characters intact, so you can encode a complete URL that contains spaces or accents without breaking its https://, path separators, or query markers.

💡 Rule of thumb: use Component encoding for individual values you're inserting into a URL (like a search term or a parameter), and Full-URL encoding when you have a complete URL that just needs its illegal characters cleaned up. Using the wrong one is a very common source of broken links and API bugs.

Common Encoded Characters

CharacterEncodedCharacterEncoded
(space)%20&%26
?%3F=%3D
#%23/%2F
+%2B@%40
:%3A%%25

Why is URL Encoding Needed?

URLs have a defined syntax where certain characters have special meaning: ? starts the query string, & separates parameters, = assigns values, / separates path segments, and # marks a fragment. If your data contains these characters literally — say a search for "fish & chips" — they'd be misinterpreted as URL structure, breaking the request. Encoding replaces them with their percent codes so they're treated as data, not syntax. The same applies to spaces and any non-ASCII characters.

When Developers Use URL Encoding

  • Query strings: safely passing search terms, filters, and parameters in a URL.
  • Form submissions: form data sent via GET is URL-encoded.
  • API requests: encoding parameters and values so they transmit correctly.
  • Links with special characters: sharing URLs that contain spaces, accents, or symbols.
  • Redirect URLs: embedding one URL inside another as a parameter (requires component encoding).

What is the Difference from HTML Encoding?

URL encoding and HTML encoding solve different problems and aren't interchangeable. URL encoding makes data safe to put in a web address using percent-codes (%20). HTML encoding makes characters safe to display in a web page using entities (like & for &), preventing them from being parsed as HTML tags. If you're building a link, use URL encoding; if you're inserting text into page content, use HTML encoding. Mixing them up leads to characters showing incorrectly or security issues.

Frequently Asked Questions

How do I encode a URL?
Select Encode, paste your text or URL, and choose the scope — Component to encode all special characters (for query values), or Full URL to keep structural characters like : / ? & = intact. The encoded result appears instantly and can be copied with one click. For example, a space becomes %20 and an ampersand becomes %26.
How do I decode a URL?
Switch to Decode and paste your percent-encoded URL or string. The tool converts the %-codes back to their original characters — %20 becomes a space, %26 becomes &, and so on. It handles multi-byte UTF-8 sequences too, so accented characters and emoji decode correctly back to readable text.
Why does a space become %20 or +?
In standard URL encoding, a space becomes %20. In the older form-encoding scheme (application/x-www-form-urlencoded) used in query strings, a space can be encoded as a plus sign (+). Both represent a space, but in different contexts. This tool uses %20 for standard encoding; when decoding, be aware some sources use + for spaces in query strings.
What's the difference between encodeURI and encodeURIComponent?
encodeURIComponent (Component mode) encodes everything including : / ? & =, making it right for encoding a single value going into a URL. encodeURI (Full URL mode) leaves those structural characters alone so a complete URL stays valid. Use Component for individual parameters and Full URL for whole addresses that just need cleaning up.
Does URL encoding handle non-English characters?
Yes. Characters outside basic ASCII — accented letters, Chinese, Arabic, emoji — are first converted to their UTF-8 bytes, and each byte is percent-encoded. For example, é becomes %C3%A9. Decoding reverses this correctly, so international characters round-trip perfectly through this tool.
Is URL encoding the same as encryption?
No. URL encoding is not encryption or security — it's a reversible formatting that anyone can decode. Its purpose is to make data safe to transmit in a URL, not to hide it. Never use URL encoding to protect sensitive information; it offers no secrecy. For security, use proper encryption.
When should I encode a URL?
Encode whenever you're placing data into a URL that might contain spaces, special characters, or non-ASCII text — search terms, form values, API parameters, or a URL embedded as a parameter in another URL. Encoding prevents those characters from breaking the URL's structure or being misinterpreted by the server.
Is my data private?
Yes. All encoding and decoding happens in your browser using JavaScript. Nothing you enter is uploaded or stored anywhere, so the tool is completely private and works instantly, even offline once the page has loaded.
Advertisement
Scroll to Top