%U
Developer/URL Encoder / Decoder

URL Encoder / Decoder

Encode or decode URLs with encodeURIComponent or encodeURI. 100% local.

100% LOCALRFC 39862 modesUnicode safeBrowser only
Saved Sessions· Auto-save on
Input
Mode:
Output
Output will appear here
Data Source & Legal Disclaimer
Effective: 2026
Sources: Browser-side processing (no external API)

This tool runs 100% in your browser. All computation happens locally on your device — your input is never uploaded to any server. Results are for reference only.

See all data sources & update policy →
How it worksPage 2

Why URLs escape special characters — illustrated

A URL is allowed to contain only a small safe alphabet (A–Z a–z 0–9 - _ . ~ plus a few reserved symbols). Anything else — spaces, &, /, ?, #, non-ASCII letters, emoji — would be misread as part of the URL structure. Encoding replaces them with % + two hex digits of their UTF-8 bytes; decoding reverses exactly that. encodeURIComponent escapes the widest set (good for a query value); encodeURI keeps structural punctuation like ? and # (good for a whole URL).

One character becomes three
encodeURIComponenta ba%20bencodeURI = same, but keeps ? # //?/?unchanged – structure kept你 → UTF-8 E4 BD A0 → %E4%BD%A0 (three escaped bytes)

A space is byte 0x20 → %20. The Chinese character 你 (U+4F60) is three UTF-8 bytes E4 BD A0 → %E4%BD%A0. Decoding walks the %XX triplets and reassembles the bytes.

A search query that survives copy-paste

You want to pass 'hello world' and a Chinese keyword in one URL query string.

  1. encodeURIComponent:hello%20world and %E4%BD%A0 — safe inside an &q= value even with & or = in the text
  2. Keep the separator:The & between params must stay literal, so you only escape each value, never the whole string
  3. The # trap:encodeURI leaves # intact → if your text has # it starts a fragment; that is why values use Component mode
  4. Round-trip:Decode restores the original bytes exactly — encode is always reversible
FAQ & detailsPage 3

To use it: open the tool, enter your inputs, and get instant results — encode and decode URLs with encodeURIComponent and encodeURI modes. Everything runs locally; nothing is uploaded.

FreeToolHub URL Encoder / Decoder is a free browser-based tool — encode and decode URLs with encodeURIComponent and encodeURI modes. No signup, no upload; everything runs locally in your browser.

About this tool

What is this tool?

Encode and decode URLs with encodeURIComponent and encodeURI modes. Full Unicode support. 100% browser-based, free, no signup.

RFC 39862 modesUnicode safeBrowser only

What Is the URL Encoder / Decoder?

This tool converts text to percent-encoded URL format and back, solving the problem that URLs may only contain a limited ASCII set. Spaces, ampersands, hashes, CJK characters, and emoji all have reserved or illegal meanings in URLs and must be encoded as %XX sequences. Two modes cover the two real-world cases: encodeURIComponent mode encodes everything including & = ? / for use as a single parameter value, and encodeURI mode preserves URL structure characters so a full URL stays functional. Full Unicode support means Chinese, Arabic, and emoji text encode correctly to their UTF-8 percent sequences.

Who Should Use This Tool?

Web developers build query strings where user input contains spaces or symbols that would otherwise break parameter boundaries. Marketers construct UTM-tagged links with campaign names containing non-ASCII characters and verify how they survive email systems. API testers encode filter values into request URLs and decode values pulled from server logs to see what was actually sent. International users pasting CJK search terms into tools that expect encoded input use it constantly. Debugging teams decode encoded URLs from analytics reports to read the original destination.

How Does It Work?

(1) Paste your text or URL. (2) Pick the mode: component mode for a parameter value, full-URI mode for a complete URL where slashes and query separators must survive. (3) Read the encoded output — spaces become %20 (or + in form-encoding contexts), non-ASCII becomes multi-byte UTF-8 sequences, reserved characters become their percent forms. (4) Decode mode reverses any percent-encoded string, handling mixed UTF-8 sequences and the + as space form convention. Everything converts live and locally.

When Do You Use encodeURIComponent vs encodeURI?

The two JavaScript functions map to the two encoding philosophies, and choosing wrong breaks URLs in different ways. encodeURIComponent is for individual values: it escapes everything with structural meaning — & = ? / # — so a value like a&b=c cannot inject fake parameters. Use it whenever user input becomes one query parameter. encodeURI is for complete URLs already assembled: it preserves the separators that make the URL work while encoding spaces and non-ASCII. Use it to sanitize a full link for display or transmission. The classic bug is using encodeURI on a parameter value, leaving & and = intact so downstream servers split the value into phantom parameters; the reverse bug mangles a full URL into unusability. This tool exposes both modes explicitly so you always pick the right one.

Frequently Asked Questions

When do I actually need to URL-encode something?

Whenever arbitrary text travels inside a URL. Reserved characters have jobs in a URL's grammar — ? starts a query, & separates parameters, # jumps to a fragment — so a value containing them must be percent-encoded (e.g. & becomes %26) or it will be misread as structure. Encode every query-parameter value you build by hand.

What is the difference between encodeURI and encodeURIComponent?

Scope. encodeURIComponent escapes everything with special meaning, so it is right for an individual parameter value (a city name, a search term). encodeURI preserves URL structure characters (?, /, &, =) so a whole URL stays parseable — using it on a parameter value leaves & and = unescaped and corrupts the query string. This tool exposes both modes so you can match the JavaScript function your code uses.

Why do spaces turn into %20 in some places and + in others?

Two standards: the HTML form specification encodes spaces as +, while RFC 3986 percent-encoding uses %20. Browsers submit forms with +, but query strings you build yourself should use %20 — and a strict decoder will not turn + back into a space. If your spaces decode wrongly, you mixed the two conventions.

Is URL encoding the same as HTML escaping?

No, and confusing them causes real bugs. URL encoding (percent-encoding) makes text safe to travel inside a URL; HTML escaping (< & ...) makes text safe to display inside an HTML document. A value that is going into a query parameter needs URL encoding first — HTML-escaping it would send literal amp; junk to the server.

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes all special characters including : / ? # [ ] @, making it suitable for encoding individual query parameter values. encodeURI preserves URL structural characters, making it suitable for encoding an entire URL. This tool supports both modes—use encodeURIComponent for parameter values, encodeURI for full URLs.

Does URL encoding affect SEO or redirect behavior?

URL-encoded characters are decoded by the server before processing, so encoding does not change the destination page. However, excessive encoding in visible URLs can look spammy to search engines. Best practice: encode only special characters in query parameters, not in the path structure. Use hyphens for word separation in URL paths.

Related tools

Joke of the Day
Sep 17

Why did the fish get bad grades?

Free core, forever

Keep the Free Edition Free

No signups, no data sold. The core of every tool is free forever — the optional Pro plan adds batch processing, unlimited downloads, white-label exports and an ad-free experience.

Support me on Ko-fi— keep tools free

100% of proceeds go towards hosting & building more free tools.