Free Online URL Encoder / Decoder
Percent-encode text for URLs or decode %20-style strings back to readable text
Try these next
Why use URL Encoder / Decoder
- Uses encodeURIComponent -- the correct encoding for query parameter values -- not the weaker encodeURI that leaves reserved characters intact.
- Full Unicode support means CJK text, emojis, and accented characters percent-encode correctly on the first try.
- Decode mode makes it easy to debug double-encoded URLs that cause broken links in production.
- Shows you exactly which characters changed, eliminating guesswork about what needs encoding.
How it works
URL encoding (formally called percent-encoding) replaces each unsafe character with a percent sign followed by two hexadecimal digits representing the character's byte value. For ASCII characters, this is straightforward -a space (byte 0x20) becomes %20, an ampersand (byte 0x26) becomes %26. For Unicode characters, the text is first encoded to UTF-8, which may produce multiple bytes per character, and each byte is then percent-encoded individually. The Japanese character あ becomes %E3%81%82 because its UTF-8 representation is three bytes: 0xE3, 0x81, 0x82. The tool uses JavaScript's built-in encodeURIComponent(), which encodes everything except unreserved characters (letters, digits, hyphen, underscore, period, tilde). Decoding reverses the process with decodeURIComponent(), converting percent-encoded sequences back to their original characters.
About this tool
You're building an OAuth redirect URL and the callback parameter contains colons, slashes, and ampersands that'll break the outer query string. Paste the value here, get the percent-encoded version, and drop it into your URL without worrying about which characters are safe. This uses encodeURIComponent -- the correct encoding for query parameter values -- which covers everything except letters, digits, and the four unreserved characters (- _ . ~). That's what you want 95% of the time when assembling URLs in code. Decode mode turns %20-style strings back to readable text so you can debug double-encoded redirects or inspect mangled query parameters from production logs. Full Unicode support means CJK characters and emojis percent-encode correctly through UTF-8 multi-byte sequences.
How to use URL Encoder / Decoder
- Paste the value you need encoded. Drop a query parameter value, callback URL, or any text with special characters into the input field.
- Read the encoded output. Spaces become %20, ampersands become %26, Unicode characters expand to their UTF-8 byte sequences. All in real time.
- Switch to decode mode if needed. Flip to Decode and paste a percent-encoded string to turn it back into readable text.
- Copy and use. Click Copy to grab the result for your code, Postman, or browser address bar.
Use cases
- A malformed redirect is breaking an API call in production. Paste the URL into decode mode, find the double-encoded parameter, fix it.
- You're testing a search endpoint in Postman and the query contains Chinese characters. Encode the value here before inserting it into the request.
Frequently Asked Questions
URL encoding (percent-encoding) replaces unsafe characters in URLs with a % followed by their hex code. For example, a space becomes %20 and an ampersand becomes %26. This is required for query string values, form data, and any text embedded in a URL to prevent breaking the URL structure.
Use encodeURIComponent for query parameter values -it encodes everything except letters, digits, and - _ . ~. Use encodeURI for full URLs -it preserves URL-structural characters like :, /, ?, and #. In practice, encodeURIComponent is what you want 95% of the time when building API requests.
Spaces are not valid characters in URLs. The percent-encoding standard replaces a space with %20 (the hex code for the space character, which is 0x20 or decimal 32). Some older systems use + for spaces in query strings, but %20 is the universal standard that works everywhere.
Any character that is not a letter (A-Z, a-z), digit (0-9), or one of the unreserved characters (- _ . ~) must be percent-encoded when used in a URL query parameter value. Common characters that need encoding include spaces, &, =, ?, #, /, and all Unicode characters.
URL encoding (percent-encoding) makes text safe to include in URLs by replacing special characters with %XX hex codes. Base64 encoding converts binary data to an ASCII string using A-Z, a-z, 0-9, +, and /. Use URL encoding for query parameters and form data; use Base64 for embedding binary data in text formats like JSON or email.
You get double-encoding. For example, encoding '%20' produces '%2520' -the % sign itself gets encoded to %25. Double-encoding is a common bug in URL-building code. If your encoded output contains %25 unexpectedly, check whether your input was already percent-encoded before you passed it to this tool.
This tool uses encodeURIComponent, which encodes everything except letters, digits, and - _ . ~. This makes it correct for encoding individual query parameter values, not full URLs (which need their structural characters like / and ? preserved). To encode a full URL, use encodeURI instead -but for 95% of use cases, you only need to encode the parameter values, which is exactly what this tool does.
Related Tools
Discover more free utilities to enhance your productivity.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to readable text
JSON Formatter & Validator
Paste messy JSON, get clean indented output
Hex to RGB Color Converter
Convert between hex, RGB, and HSL color codes
Text to Slug Converter
Turn any title or phrase into a URL-safe slug