Skip to content
← Back

URL Encoder/Decoder - Online URL Encode/Decode

Text
Runs locally · Not uploaded

Online URL encoder and decoder tool. Supports URI component encoding (encodeURIComponent) and full URL encoding. Processed locally in your browser.

Was this result helpful?

For local tools, open DevTools → Network and search your input — it should not appear in requests.

Next steps

Usage Guide

URLs admit only a subset of ASCII: Chinese characters, spaces, &, = and # either lose their meaning or break the link outright when concatenated raw. This tool offers Component (encodeURIComponent) or Full URI (encodeURI) mode, plus encode “space as +”, decode “+ as space”, lenient keep-invalid-%, and peel-all-layers — fully locally.

1. Encode and decode

Strict decode (default) raises URIError on a lone % (e.g. literal 100%). Lenient keeps invalid fragments while still decoding valid %HH runs — handy for half-cut strings from logs.

  1. Pick Component (param/path segment) or Full URI (whole address; keeps :/?#&=).
  2. Encode: spaces become %20 by default; enable “space as +” for form/query habit.
  3. Decode: enable “+ as space” for form strings; “lenient” for truncated logs; “peel all layers” when you suspect double encoding (layer count shown beside output).
  4. Copy and substitute into your link or code.

2. encodeURI or encodeURIComponent

encodeURI keeps URL structure characters and suits whole URLs; encodeURIComponent encodes & = / too and suits values. The page mode switch maps to these two APIs. Rule: whole link → Full URI; parameter values → Component.

3. Three frequent traps

  • Spaces: %20 vs +. Use “space as +” on encode and “+ as space” on decode as a matching pair.
  • Double encoding: %2520 is %20 encoded again. Peel-all-layers restores it and reports the depth (2 = encoded twice).
  • Unencoded specials in param values break links intermittently.

4. Boundaries of this tool

Default Component writes spaces as %20; form-style + only when the encode toggle is on. Decode leaves + alone and throws on malformed % unless those toggles are enabled. Full URI uses encodeURI/decodeURI. For structured split/rebuild use url-parser / url-params-parser.

5. Encoding chains for CJK and special characters

  • 中 → %E4%B8%AD (three UTF-8 bytes).
  • In form-urlencoded, + means space; under default decode, + is a plus.
  • Repeated %25 prefixes — or peel depth ≥ 2 — usually mean double encoding.

6. Form encoding vs path encoding vs query strings

Three situations get lumped under “URL encoding”: spaces/CJK in path segments (almost always %20 / UTF-8 percent-encoding), query parameter values (%20 or legacy form +), and application/x-www-form-urlencoded bodies (where + means space by spec). This page’s Component / Full URI modes separate “encode one value” from “encode a whole URI”; space-as-+, +-as-space, lenient, and peel-layers are debugging switches, not default production policy. For structured add/remove of params, switch to the URL params parser instead of hand-editing & in a string.

7. Checklist when encoding still yields HTTP 400

  • Locate the layer: address bar, reverse-proxy logs, or the app’s query parser — each may encode or decode again.
  • JSON in a query must be Component-encoded as a whole; encoding only inner CJK while leaving braces raw splits on &.
  • Runs of %25 in logs: peel to see depth, then decide whether the gateway double-encoded or the client called encode twice.
  • Full URI mode will not encode existing ?&=; if your “full URL” is actually a callback value destined for a parameter, use Component.
  • IDN hostnames may display as Unicode in the browser but travel as xn-- Punycode on the wire — this page handles percent-encoding of paths/params, not IDN ↔ Punycode conversion.

FAQ

It depends on whether you are encoding a value or a whole address: encodeURIComponent encodes / ? : & = too, which is right for parameter values; encodeURI preserves URL structural characters for complete links. The page's Component / Full URI modes map to these two semantics. One rule of thumb: full links take Full URI, parameter values always take Component.

RFC percent-encoding uses %20; application/x-www-form-urlencoded (form submissions and many query parsers) uses +. The tool outputs %20 by default and produces form style only with “encode space as +” enabled; on the decode side + stays literal unless “treat + as space” is on. Read the two switches as a pair.

%2520 is a space encoded twice (%20 encoded again); enable “peel all layers” to restore it in one go and see how many layers there were. A lone % (as in the literal 100%) throws a URIError in the strict default mode — with “lenient” on, invalid fragments stay untouched while valid %HH runs still decode, which suits half-truncated strings pulled from logs.

Check three layers: JSON in a query string must be Component-encoded as a whole — encoding only the Chinese inside while leaving braces naked gets chopped at the first &; repeated %25 runs in logs mean double encoding, so peel to see the depth and find whether the gateway or the client encoded twice; and Full URI mode never encodes existing ?&=, so switch to Component when a whole URL is itself a parameter value.

URL standards allow only an ASCII subset, so 「中」 must become its UTF-8 percent form %E4%B8%AD (three bytes, three %XX triplets) to travel correctly. Chinese domain names are a separate matter: browsers display Unicode while the wire carries xn-- Punycode. This page handles percent-encoding, not IDN/Punycode conversion.

Nowhere at all. Encoding, decoding, and layer-peeling in every mode run locally in your browser — the link never leaves your device.

Related Tools

Related Articles