URL Encoder / Decoder
Encode text and URLs to percent-encoding or decode encoded URLs back to plain text. Switch between encodeURIComponent and encodeURI, right in your browser.
Default (encodeURIComponent): escapes reserved characters like & = ? / - safe for a single query value or path segment.
About URL Encoder / Decoder
Use this free URL encoder and decoder to convert text and links to percent-encoding (URL encoding) or decode an encoded URL back to readable text. Choose between encodeURIComponent - which escapes reserved characters like &, =, ?, and / so a value is safe inside a query string - or encodeURI, which keeps a full URL's structure intact. Everything runs client-side in your browser, so nothing is uploaded.
How to Use URL Encoder / Decoder
- Choose Encode or Decode with the buttons at the top.
- When encoding, pick "Encode component (encodeURIComponent)" for a single value, or "Encode full URL (encodeURI)" for a complete link.
- Paste your text or URL into the input box.
- Press Encode or Decode and copy the result from the output box.
URL Encoder / Decoder Examples
Encode a query value
hello world & more becomes hello%20world%20%26%20more
Encode a full URL
https://example.com/a b?q=1 becomes https://example.com/a%20b?q=1 with encodeURI
Decode an encoded URL
https%3A%2F%2Fexample.com%2Fsearch decodes to https://example.com/search
Read the full guide
How to Use URL Encoder / Decoder: Complete Guide (2026) - 5 min read
Frequently Asked Questions about URL Encoder / Decoder
- What is URL encoding (percent-encoding)?
- URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in a URL with a % followed by two hexadecimal digits representing the byte value. For example a space becomes %20 and an ampersand becomes %26. It lets you safely include spaces, symbols, and non-ASCII characters in a URL, query string, or form submission.
- What is the difference between encodeURIComponent and encodeURI?
- encodeURIComponent escapes almost every reserved character - including & = ? / # : @ + and space - so it is the right choice for a single query-string value or path segment. encodeURI leaves the characters that make up a URL's structure (: / ? & = #) untouched, so it is meant for encoding a complete URL that already contains those delimiters. As a rule: use encodeURIComponent for the parts, encodeURI for the whole.
- Which characters get encoded?
- Unreserved characters (A-Z, a-z, 0-9, and - _ . ! ~ * ' ( )) are never encoded. Reserved and unsafe characters - spaces, &, =, ?, /, #, %, and any non-ASCII character such as accented letters or emoji - are converted to one or more %XX bytes (UTF-8). encodeURIComponent encodes the reserved delimiters too, while encodeURI preserves them.
- How do I build a query string safely?
- Encode each value with encodeURIComponent before joining them with & and =. For example, `?q=` + encodeURIComponent('shoes & socks') produces `?q=shoes%20%26%20socks`. This prevents a value that contains &, =, or a space from being mistaken for a delimiter and breaking your query string.
- Why do I get an error when decoding?
- Decoding fails when the input contains a malformed percent-escape - a lone "%" not followed by two hex digits, or an invalid sequence like "%zz". Check that every "%" is followed by a valid two-digit hex code. Text that was never URL-encoded will pass through unchanged unless it contains a stray "%".
- Is my data sent to a server?
- No. All encoding and decoding happens entirely in your browser using the standard encodeURIComponent, encodeURI, and decodeURIComponent functions. Nothing you paste is uploaded, logged, or stored.