Devbelt

URL Encoder / Decoder

Percent-encode, decode, or parse a query string

PLAIN TEXT
URL-ENCODED
Output appears here as you type.
Type text to percent-encode.

Everything runs in your browser. Nothing you paste is ever uploaded or stored on a server.

About

Put a space, an ampersand, or an accented letter straight into a URL and the request either breaks or gets read wrong. This tool converts text to and from percent-encoding as you type. You can encode one piece of a URL, like a single query value, or a whole URL that needs to keep its :/?#&= working. There's also a Query mode that splits a URL into its separate parameters. Everything happens in your browser, so pasting a token or a private link is safe.

Why URLs need encoding

URLs can only contain a certain set of characters, and a few of them, like ? & = / #, are structural. They tell the URL where the query starts, where one parameter ends and the next begins, and so on. If a value you're dropping into a URL contains one of those characters, or a space, or anything outside plain ASCII, you have to percent-encode it first. Otherwise the browser or server reads your data as part of the URL's structure and the whole thing falls apart. Percent-encoding swaps each unsafe character for a % followed by the hex value of its byte.

How percent-encoding works

First the text gets turned into bytes using UTF-8. Then any byte that isn't one of the safe "unreserved" characters (A-Z, a-z, 0-9, and - _ . ~) gets written out as %HH, where HH is that byte in hex. A plain space becomes %20. Anything outside ASCII takes more than one byte in UTF-8, so a single character can turn into several percent codes in a row.

a b   →  a%20b
café  →  caf%C3%A9      (é is two UTF-8 bytes: C3 A9)

Component vs whole-URL

There are two modes here, and picking the wrong one is the classic mistake:

  • Component mode escapes almost everything, including / ? # & =. Use it when you're encoding one piece of a URL, like a single query value or a path segment.
  • Full-URL mode leaves those structural characters alone. Use it when you already have a complete URL and just want to fix the spaces and non-ASCII characters without breaking the URL itself.

Run a whole URL through component mode and it escapes the :// and the separators, leaving you with a mess. Run a single value through full-URL mode and it can leave characters unescaped that should have been encoded.

The + versus %20 confusion

In real percent-encoding a space is %20. But old HTML forms, the ones submitted as application/x-www-form-urlencoded, use a + for a space instead. Two different conventions from two different places. This tool uses %20. If you're decoding something that came out of a form and the spaces show up as +, swap the + back to a space before you decode.

Frequently asked questions

What is URL encoding (percent-encoding)?
URL encoding replaces characters that aren't safe in a URL, such as spaces, &, ?, and non-ASCII letters, with a % followed by their hex byte value. For example, a space becomes %20. It keeps URLs valid and unambiguous.
What's the difference between component and full-URL encoding?
Component encoding (encodeURIComponent) escapes almost everything, so use it for a single query value or path segment. Full-URL encoding (encodeURI) leaves the structural characters : / ? # & = intact, so use it to encode a whole URL without breaking it.
Why does my decode say the input is malformed?
The text contains an invalid percent-sequence, usually a lone % or an incomplete %XY. Check for stray % characters or a truncated string.
Should a space be + or %20?
This tool uses standard percent-encoding, where a space is %20. The + convention comes from HTML form submissions (application/x-www-form-urlencoded); if you're decoding form data, replace + with a space first.
Can I break a URL into its query parameters?
Yes. Switch to Query mode and paste a URL or a bare query string. Devbelt splits it at each & and =, decodes every key and value, and shows them as a table. You can also copy the whole set as a JSON object.
Is my text uploaded anywhere?
No. All encoding and decoding happens in your browser. Nothing you paste is sent to or stored on a server.

Related tools