URL Encoder, Decoder & Query String Parser — Free Online Tool

Percent-encode and decode URLs with encodeURIComponent or encodeURI, toggle + as space, and parse full URLs into clean decoded query parameter tables.

100% Client-Side • Your data stays in your browser
How to use & FAQ
Loading tool...

URL Encoder & Decoder

Uniform Resource Locators (URLs) can only safely transmit a restricted set of ASCII characters across browsers, proxies, and backend routers. Whenever a query parameter contains spaces, ampersands, non-Latin accents, or emoji, it must be percent-encoded before being placed into a link or API request. Our free online URL Encoder, Decoder & Query Parser transforms strings bidirectionally in real time inside your browser—with zero server uploads. Unlike basic single-mode encoders, this utility lets you switch explicitly between encodeURIComponent (for query parameter values) and encodeURI (for preserving complete URL syntax), toggle form-style plus-sign (+) space handling, and inspect complex tracking or OAuth redirect URLs in a structured Query String Parser table.

How to Use This Tool

  1. 01 Choose Encode to convert plain text or raw URLs into percent-encoded form, or choose Decode to turn %XX sequences back into readable UTF-8 text.
  2. 02 Select encodeURIComponent when encoding an individual query parameter value (it escapes /, ?, &, =, :, and #), or select encodeURI when encoding a complete URL whose structural delimiters must remain intact.
  3. 03 Toggle Treat + as space on when working with HTML form submissions or application/x-www-form-urlencoded query strings where spaces are represented as +.
  4. 04 Click Swap to move your transformed output back into the input box and flip direction for quick round-trip verification.
  5. 05 Switch to the URL Query Parser tab and paste any full URL, protocol-less domain, or ?query string to inspect its protocol, host, path, hash, and every decoded key/value pair.
  6. 06 Use Copy Output or individual row Copy buttons to grab clean values immediately.

How It Works

Percent-encoding (defined by RFC 3986) converts any non-unreserved character into its UTF-8 byte sequence and represents each byte as a percent sign followed by two uppercase hexadecimal digits (for example, a space becomes %20 and the accented letter é becomes %C3%A9). JavaScript’s encodeURIComponent escapes all characters except A–Z, a–z, 0–9, - _ . ! ~ * ' ( ), making it safe for parameter values that might otherwise inject extra & or = delimiters. By contrast, encodeURI leaves reserved URL delimiters (:, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =) untouched so a full web address stays navigable. When decoding malformed input—such as a truncated %E0%A4%A UTF-8 sequence or a stray % sign—the tool catches the URIError gracefully and pinpoints the offending sequence instead of crashing. The Query Parser splits the URL via the WHATWG URL API (auto-assuming https:// if the scheme is omitted) and decodes each parameter individually so one broken key never hides the rest.

Practical Examples

Encoding a Query Parameter Value with encodeURIComponent

Input
                      café & JSON formatter
                    
Output
                      caf%C3%A9+%26+JSON+formatter
                    

The ampersand (&) is encoded as %26 so it will not split the query string into a second parameter, é becomes UTF-8 %C3%A9, and spaces become + when Treat + as space is enabled.

Encoding a Full URL with encodeURI

Input
                      https://manytoolshub.com/docs/guía rápida?q=hello world
                    
Output
                      https://manytoolshub.com/docs/gu%C3%ADa%20r%C3%A1pida?q=hello%20world
                    

With encodeURI (and + as space disabled), protocol colons, slashes, and query delimiters stay intact while non-ASCII characters and spaces are safely encoded.

Parsing a Complex Redirect URL

Input
                      https://example.com/auth/callback?code=abc123&redirect=https%3A%2F%2Fapp.example.com%2Fhome#done
                    
Output
                      Protocol: https: | Host: example.com | Path: /auth/callback | Hash: #done | Params: code=abc123, redirect=https://app.example.com/home
                    

The URL Query Parser separates structural parts from nested encoded query parameters so you can inspect OAuth callbacks and UTM links in seconds.

Tips & Best Practices

  • Always use encodeURIComponent—never encodeURI—when embedding a URL inside another URL’s query parameter (such as a redirect_uri or callback parameter).
  • Avoid double-encoding: if a string already contains %20, encoding it again turns % into %25, producing %2520.
  • Remember that + only means space inside query strings (application/x-www-form-urlencoded); inside URL path segments, a literal space must be %20.
  • If decoding throws a malformed percent-encoding error, look for an unescaped literal % (like "50% off") that should have been written as %25.
  • Because all encoding and parsing runs locally in your browser, you can safely inspect private OAuth tokens, signed S3 URLs, and webhook links without leaking credentials.

Frequently Asked Questions

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes reserved URL characters like /, ?, &, =, :, and #, which makes it right for individual query parameter values. encodeURI preserves those structural characters so you can encode a full URL without breaking its protocol or path.

When should I enable "Treat + as space"?

Enable it when working with HTML form payloads or query strings (application/x-www-form-urlencoded) where spaces are encoded as +. Disable it when encoding URL paths or RFC 3986 strict strings where spaces must be %20 and + is a literal plus sign.

Why does decoding fail with a malformed percent-encoding error?

A URIError occurs when the input contains a lone % not followed by two hexadecimal digits (such as "100%"), or an incomplete multi-byte UTF-8 sequence (such as %E0%A4%A). Our tool flags the exact sequence so you can fix it.

Does the tool support Unicode accents, CJK characters, and emoji?

Yes. All characters are encoded and decoded as standard UTF-8 byte sequences, handling accented Latin characters, Arabic, CJK scripts, and multi-byte emoji accurately.

Are my URLs or query parameters sent to a server?

No. Everything runs 100% locally in your browser using JavaScript. Sensitive query tokens, API keys, and internal endpoints never leave your device.

Related Tools