Skip to content

URL Encoder / Decoder

URLs can only safely contain a specific set of ASCII characters. Anything outside that set \u2014 spaces, quotes, curly braces, emoji, non-Latin characters \u2014 must be percent-encoded (converted to %XX hex notation). This tool handles both directions: encode plain text for safe URL use, or decode a percent-encoded URL back to readable text.

Component vs Whole URI Encoding

Component mode (encodeURIComponent) escapes everything except a small safe set. Use it for individual URL parts like query string values: encodeURIComponent("hello world") becomes hello%20world. Whole URI mode (encodeURI) preserves URL structure characters like / ? # & = + \u2014 use it when you have a full URL you want to make safe without breaking its structure.

Frequently Asked Questions

When should I use encodeURIComponent vs encodeURI?+
Use encodeURIComponent for query values and individual URL parts \u2014 it escapes everything that could have URL meaning. Use encodeURI on a complete URL that already has correct structure but may contain unsafe characters (like spaces or Unicode). 95% of the time you want encodeURIComponent.
Why do Unicode characters become so long when encoded?+
Each non-ASCII character is encoded as its UTF-8 byte sequence in percent-encoded form. Most emoji span 3-4 bytes, so a single emoji expands to 9-12 percent-encoded characters (like %F0%9F%98%80 for \ud83d\ude00).
Why does decoding sometimes throw an error?+
Decode throws when it hits a malformed percent sequence \u2014 like %GG (invalid hex) or a lone % without two hex digits after it. Check your input for incomplete encoding. A single rogue % character is the most common cause.

Built by Derek Giordano \u00B7 Part of Ultimate Design Tools

Privacy Policy \u00B7 Terms of Service