Skip to content

URL Encoder & Decoder

Percent-encode or decode text and query strings so they are safe to use inside a URL.

Runs in your browserFree, no sign-up

Settings

Results update automatically as you type.

Encoded

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

About the URL Encoder & Decoder

This URL encoder converts text into percent-encoded form so it can travel safely inside a web address, and decodes it back again. Two scopes are offered: component encoding, which escapes the reserved characters such as ampersand, question mark, equals and slash and is what you want for a single query value or path segment; and full URI encoding, which leaves those structural characters alone so a complete address stays usable. Invalid escape sequences are reported rather than producing silent corruption. Encoding and decoding both run in your browser, so URLs containing tokens can be pasted safely.

How to use the URL Encoder & Decoder

  1. 1

    Paste the text or URL into the 'Text or URL' box.

  2. 2

    Set 'Action' to Encode or Decode.

  3. 3

    Choose the 'Encoding scope': Component escapes & ? = and /, while Full URI keeps them intact.

  4. 4

    Copy the encoded or decoded result from the panel below.

What people use it for

Building query strings by hand

A search term such as 'shoes & socks' will terminate the parameter early if pasted raw. Component-encoding the value turns the ampersand into %26 so the whole phrase reaches the server as one parameter.

Debugging redirect and callback URLs

OAuth redirect_uri values are URLs nested inside URLs, which is why they arrive double-encoded and unreadable. Decoding them once or twice shows exactly what the provider actually received.

Reading analytics and referrer data

Campaign parameters and referrer paths in logs arrive percent-encoded. Decoding a row makes the original search query or landing path readable at a glance.

Passing structured data in a link

JSON or a filter expression placed in a query parameter must be component-encoded, or its braces, quotes and colons will confuse both the browser and the server.

What percent-encoding is and which characters need it

Percent-encoding is defined by RFC 3986, the standard that specifies URI syntax. It represents a byte as a percent sign followed by two hexadecimal digits, so a space becomes %20 and an ampersand becomes %26. The standard divides characters into three groups. Unreserved characters — the ASCII letters, the digits, hyphen, full stop, underscore and tilde — may always appear literally and should never be encoded. Reserved characters, which includes : / ? # [ ] @ ! $ & ' ( ) * + , ; =, carry structural meaning in a URI; they may appear literally where that meaning is intended and must be encoded where the character is part of the data instead. Everything else must be encoded. For non-ASCII text, RFC 3986 specifies that the characters are first encoded as UTF-8 and then each resulting byte is percent-encoded, which is why a single accented letter produces two escape sequences and a typical emoji produces four. That UTF-8 step is what makes modern percent-encoding unambiguous; before it was standardised, the same escape sequence could mean different characters depending on the page's charset.

Component scope versus full URI, and the plus sign

The distinction between the two scopes is the single most common source of confusion. Component encoding escapes the reserved characters, because inside a value they are data rather than structure — a slash in a filename must not be mistaken for a path separator. Full URI encoding deliberately leaves : / ? # [ ] @ & = + $ , alone so that a complete, already-structured address survives the process intact and remains clickable. Use component scope for a parameter value or a path segment; use full URI scope when tidying an address that contains a space or an accent but whose structure is already correct. Neither scope escapes the unreserved characters, so hyphens, full stops, underscores and tildes pass through untouched by design. The other perennial confusion is the plus sign. Percent-encoding always represents a space as %20. The convention of writing a space as + belongs to application/x-www-form-urlencoded, the media type HTML forms use for submissions, and it applies to the query string of a form post rather than to URIs generally. A literal plus sign in a value must therefore be encoded as %2B, or a form-decoding server will silently turn your plus into a space.

Tips

  • Encode each parameter value separately with component scope, then assemble the URL — encoding the finished string escapes your own delimiters.
  • If a decoded result still contains %25 sequences, the value was double-encoded; decode it again.
  • Never encode the unreserved characters manually — %2E instead of a full stop is legal but some servers normalise it inconsistently.

Frequently asked questions

When should I use component encoding versus full URI?
Use component encoding for a single query value or path segment, because it escapes characters like &, ? and / that would otherwise break the URL structure. Use full URI when encoding a complete URL you want to stay usable.
Why does a space become %20 sometimes and + other times?
Percent encoding uses %20 for a space. The plus sign is only used in the older application/x-www-form-urlencoded format used by HTML form submissions.
Is it safe to paste URLs containing tokens?
Yes. Encoding and decoding happen entirely in your browser, so nothing is transmitted or logged anywhere.

Looking for something else? Browse all text tools or see every tool.