URL Encoder Decoder

Encode and decode URLs and URL components. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/URL Encoder / Decoder

URL Encoder / Decoder

Encode, decode, parse, and build URLs with advanced percent-encoding controls, query-string builder, IDN support, batch processing, and more.

Input

0 chars

Encoded Output

0 chars

Quick Actions

Frequently Asked Questions

What is the difference between encodeURIComponent and encodeURI?

The difference is how much they encode. encodeURIComponent escapes every reserved character, including : / ? # @ & = + $, so it is meant for a single piece of a URL — typically one query-string value. If that value contained a stray & or =, encoding it prevents the value from accidentally starting a new parameter. encodeURI is gentler: it preserves the structural characters : / ? # so an already-assembled, complete address stays usable as a URL. The rule of thumb is to use encodeURIComponent on the small fragment you are slotting into a URL, and encodeURI on a whole URL you do not want to break apart. Using the wrong one is the single most common URL bug. This tool exposes both as separate scopes, plus path-only and query-only modes, so you can apply exactly the right level.

Why does my URL break when it contains a space or an ampersand?

URLs can only safely carry a limited set of characters, and some characters are reserved because they have a structural meaning. A space is not allowed at all and must become %20, otherwise browsers, servers, and link parsers may truncate the address at the gap. An ampersand is worse: inside a query string & separates one parameter from the next, so an unencoded & sitting inside a value gets read as the start of a brand-new parameter, splitting your data. Encoding it to %26 keeps it as literal text. The same applies to #, which marks a fragment, and ? and / which mark the query and path. Percent-encoding replaces each of these with a safe %-prefixed code. Paste your link into the tool, choose the right scope, and it escapes the unsafe characters for you so the URL holds together.

What is the difference between + and %20 for encoding spaces?

Both can represent a space, but they belong to different encoding schemes and are not always interchangeable. %20 is the standard percent-encoding for a space and is valid anywhere in a URL — the path, the query, or a fragment. The plus sign only means a space in one specific context: application/x-www-form-urlencoded data, which is how an HTML form submits values. In that format a literal space becomes +, and a literal + must itself be encoded as %2B to avoid being misread as a space. Outside form encoding, a + in a URL is just a plus sign and is not decoded to a space. Mixing the two is a frequent source of bugs where a name like "John Doe" arrives as "John+Doe". This tool offers a dedicated form URL-encoded mode alongside standard percent-encoding so you can pick the convention your endpoint expects.

What does %2520 mean and how do I fix a double-encoded URL?

%2520 is the tell-tale signature of double encoding — a string that was percent-encoded twice. A space first becomes %20; if that result is then encoded again, the % itself gets escaped to %25, turning %20 into %2520. You will often see clusters of stray 25 sequences scattered through a mangled link, like %253A or %252F. It usually happens when code encodes a value that was already encoded, for example wrapping an entire pre-built URL in encodeURIComponent. The fix is simply to decode the string twice: decoding once converts %2520 back to %20, and decoding again recovers the original space. This tool's validator flags double encoding when it detects the pattern, and you can run the decode operation repeatedly to peel back each layer until the URL looks normal again. Paste the suspicious link to confirm and recover the original.

How do I encode an international domain name with accented or non-Latin characters?

Hostnames follow different rules from the rest of a URL: the host cannot contain non-ASCII letters directly, and it does not use percent-encoding the way a path or query does. Instead, internationalized domain names are converted to Punycode, an ASCII-compatible encoding that prefixes the converted label with xn--. For example, münchen.de becomes xn--mnchen-3ya.de, which is the form that actually travels through DNS, while browsers display the friendly Unicode version to users. The conversion is reversible, so you can turn a Punycode host back into its readable form to verify what a link really points to — useful when checking for look-alike or spoofed domains. This tool's IDN converter handles both directions using the browser's native URL normalization, keeping the host separate from the percent-encoding you would apply to the path and query. Paste a domain to convert it to or from Punycode.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/url-encoder" title="URL Encoder Decoder — The Toolbox" width="100%" height="220" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/utility-tools/url-encoder?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free URL Encoder Decoder</a> by The Toolbox</p>

About the URL Encoder Decoder

The URL Encoder Decoder converts text and web addresses to and from percent-encoded form — the %-prefixed notation a browser uses to carry characters that are unsafe or reserved in a URL. Paste a string and it encodes or decodes it instantly, with controls for exactly how aggressive the encoding should be. It's built for developers, QA engineers, marketers wiring up tracking links, and anyone who has ever had a URL break because of a space, an ampersand, or an accented character.

Everything runs locally in your browser using the platform's own encodeURIComponent, encodeURI, and URL APIs. Your input is never sent to a server, so you can safely paste links that contain access tokens, internal hostnames, or campaign data. There is no sign-up, no length cap, and nothing to install.

Picking the right encoding scope

The most common URL bug is using the wrong level of encoding, so the tool exposes five distinct scopes instead of a single button:

  • encodeURIComponent — encodes every reserved character, including : / ? # @ & = + $. Use this for an individual query-string value, where a stray & would otherwise start a new parameter.
  • encodeURI (full URL) — preserves structural characters like : / ? # so a complete, already-assembled address stays usable. Use it on a whole URL, not on a fragment you're slotting into one.
  • Query string only and path only — encode just one part of the URL and leave the scheme, host, and remaining sections intact.
  • Form URL-encoded — the application/x-www-form-urlencoded format, where spaces become + rather than %20. This matches how HTML forms submit data, which is why + and %20 are not always interchangeable.

A quick reference: a space is %20 (or + in form encoding), & is %26, # is %23, ? is %3F, and / is %2F. The built-in character reference table lists these and more so you can decode mystery sequences by hand.

Parse, build, and compare URLs

Beyond raw conversion, the encoder breaks a URL into its parts. The URL Parser splits any address into scheme, username, password, host, port, path, query, and fragment, and flags whether the URL is structurally valid. The Query Builder lets you assemble or edit key=value pairs in a table and emits a correctly encoded query string — handy when a value itself contains an = or &. The Comparison view shows input and output side by side so you can confirm exactly what changed.

The validator also warns about a frequent trap: double encoding, where an already-encoded string is encoded again and %20 turns into %2520. If a link looks mangled with extra 25 sequences, that's the signature, and decoding twice usually recovers the original.

International domains and batch work

Hostnames can't contain non-ASCII letters directly, so internationalized domain names are converted to Punycode — an ASCII-compatible encoding prefixed with xn--. The IDN tool turns münchen.de into xn--mnchen-3ya.de and back, using the browser's native URL normalization. This matters because the host portion of a URL follows different rules from the path and query, which use percent-encoding instead.

For repetitive jobs, Batch mode processes a whole list at once — paste one URL or value per line, pick a mode and scope, and copy every result together. A History panel keeps your recent conversions during the session so you can revisit a result without re-pasting.

Whether you're debugging a redirect, hand-building a UTM-tagged campaign link, or just decoding a long string someone sent you, the URL Encoder Decoder gives you precise control over each part of the address — entirely in your browser, with nothing uploaded.