URL Encoder / Decoder
Developer Tools
Encode or decode URLs and URL components. Choose between component encoding (for query parameters) and full-URL encoding (for entire URLs).
Runs entirely in your browserAbout URL Encoder / Decoder
URL encoding (also called percent-encoding) replaces characters that have a special meaning in URLs — spaces, `&`, `?`, `=`, `#`, and non-ASCII text — with `%`-prefixed hex sequences so they can travel safely in a URL. This tool exposes both built-in JavaScript URL encoders: `encodeURIComponent` (Component mode), which escapes everything that isn't an unreserved character, and `encodeURI` (Full URL mode), which leaves URL structure characters like `:`, `/`, `?`, and `&` alone.
Use Component mode for individual query-string values, path segments, or anything that will be concatenated into a URL — it's almost always the right choice. Use Full URL mode when you have a complete URL that needs minimal cleanup (typically when you're escaping a URL someone provided as a raw string). The tool handles UTF-8 correctly out of the box. Decoding works in reverse, with appropriate error handling for malformed percent sequences.
How to use
- 1
Pick a direction
Choose the Encode or Decode tab.
- 2
Choose the mode
Component (encodeURIComponent) for query values; Full URL (encodeURI) for entire URLs.
- 3
Paste your text
Plain text to encode, or an encoded URL/string to decode. Output updates live.
- 4
Copy the result
Use the Copy button to take the encoded or decoded text.
Examples
Component encoding (query value)
Spaces become `%20`, `&` becomes `%26`, `?` becomes `%3F`.
Input
hello world & friends?Output
hello%20world%20%26%20friends%3FFull URL encoding
`encodeURI` leaves URL structure intact, only escaping spaces and non-ASCII.
Input
https://example.com/path with spaces?q=caféOutput
https://example.com/path%20with%20spaces?q=caf%C3%A9Decoding back
Decoding reverses both modes.
Input
hello%20world%20%26%20friends%3FOutput
hello world & friends?Frequently asked questions
Which mode do I want?+
Use Component for nearly everything — encoding a query value, a path segment, or anything you'll concatenate into a URL. Use Full URL only when you have an entire URL that just needs spaces and non-ASCII characters escaped.
Why does Component encoding escape `&` but Full URL doesn't?+
`&` is a separator in URLs (between query parameters). `encodeURI` preserves URL structure, so it leaves `&` alone. `encodeURIComponent` assumes you're encoding a single value that needs to survive concatenation, so it escapes `&` too.
Does it support non-ASCII characters?+
Yes — UTF-8 is handled correctly. Emoji and CJK characters become percent-encoded UTF-8 byte sequences.
Why did decode throw an error?+
The input contains an invalid percent sequence (e.g. `%ZZ` or a truncated `%2`). Check the input — most often this happens when you double-decode something or when manual edits corrupt the encoding.
Is my data sent anywhere?+
No. Both encoding and decoding use the browser's built-in functions; nothing is transmitted.
Related tools
JSON Formatter
Format, beautify, and explore JSON with an expandable tree view. Includes indent control and minify.
JSON Validator
Validate JSON structure and pinpoint syntax errors by line and column.
HTML Formatter
Clean and indent messy HTML for better readability.
CSS Formatter
Format and organize CSS automatically with configurable brace and indent styles.
SQL Formatter
Beautify SQL queries with proper indentation across Postgres, MySQL, SQLite, and MSSQL dialects.
XML Formatter
Format XML into a clean, readable structure with attribute control.