Skip to content
nah

URL Encoder / Decoder

Encode, decode, and parse URLs and query strings — instantly, in your browser.

100% in your browser — files never leave your device

Encoded output

Output appears here.

How URL encoding, decoding, and parsing work

Encode mode wraps the two built-in JavaScript functions people actually need: encodeURIComponent for a single value going into a query string, and encodeURI for a complete URL where you want to preserve the structural characters (: / ? # & =) and only encode the rest. Pick wrong and a fully-encoded query value ends up double-encoded, or a component-encoded full URL gets mangled — the toggle here makes the choice explicit.

Parse mode accepts either a full URL or a bare query string and breaks it into protocol, host, pathname, hash, and a table of every query parameter — built on the native URL and URLSearchParams classes rather than a hand-rolled parser, so edge cases like repeated keys are handled the way browsers actually handle them.

Decode mode intentionally throws on malformed percent-encoding — a bare % or an invalid hex pair — rather than silently passing it through mangled. That's the same behavior decodeURIComponent has in any JavaScript runtime, surfaced here as a readable error instead of a console exception.

Frequently asked questions

Is anything sent to a server?

No. Encoding, decoding, and URL parsing all run in your browser using native JavaScript APIs. No data leaves your device.

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ). encodeURI additionally leaves : / ? # [ ] @ & = + $ , ; % intact — it is meant for full URLs where you want to preserve URL structure. Use encodeURIComponent for individual query values; use encodeURI when encoding a complete URL.

Why does decoding sometimes show an error?

decodeURIComponent throws on malformed percent-sequences like a bare % or %xy where xy is not valid hex. The tool surfaces the browser's exact error so you can identify the offending character.

Related tools