URL Encoder & Decoder

Encode text for use in a URL, or decode percent-encoded parameters back to readable text.

← All tools

Short answer: Encode text into percent-encoded URLs that are safe for query strings and links, or decode encoded URLs back into readable text. Everything runs in your browser — useful for developers building links and anyone sharing URLs packed with special characters.

Last updated: October 13, 2026

Runs entirely in your browser — nothing you paste is uploaded or stored.

How it works

URLs can only safely contain a limited set of characters. Percent-encoding replaces everything else — spaces, ampersands, question marks, accents, emoji — with a % followed by two hex digits, so the text survives the trip through an address bar, a link, or a query string.

Type or paste on the left and the result updates live on the right. Encode prepares text to be placed inside a URL; Decode turns percent-encoded text back into readable form. This tool encodes the full component (including /, ? and &), which is what you want for query parameter values.

A worked example

The sample link loaded in the tool contains a space and an ampersand, neither of which is safe raw inside a URL:

https://dailytoolhub.net/?q=word counter&lang=en

Encoded, it becomes:

https%3A%2F%2Fdailytoolhub.net%2F%3Fq%3Dword%20counter%26lang%3Den

Notice the space became %20 and the ampersand became %26 — a server reading this gets exactly the text you meant.

Frequently asked questions

When do I need to encode text for a URL?

Whenever text goes into a query string or path and might contain spaces, ampersands, question marks, or non-ASCII characters — search terms, names, and messages are the classic cases.

What is the difference between encoding a component and a whole URL?

This tool encodes a component: separators like / ? and & are encoded too, because the text is meant to sit inside one parameter value. Encoding a full URL would leave those separators intact so the address still works.

Why did decoding fail?

Decoding fails when a % is not followed by two valid hex digits, or the encoded bytes are not valid UTF-8. Check for truncated or hand-typed percent codes.

Is a plus sign the same as %20?

In query strings, + is often treated as a space by servers, but the portable, always-correct encoding for a space is %20, which is what this tool produces.

Is my text uploaded anywhere?

No. Encoding and decoding run with functions built into your browser. Nothing leaves your device.

Should I encode the whole URL or just the parameter value?

Just the value. Encoding a full URL would also encode the ://, ?, and & that give the URL its structure. Encode each value first, then assemble the URL around the encoded pieces.

What is the difference between %20 and + for a space?

In HTML form data, + means a space; everywhere else in a URL, + is a literal plus sign and %20 is the space. When in doubt, use %20 — it is correct in all positions.

What is double encoding?

Encoding an already-encoded string. Encoding "%20" again produces "%2520" (the % itself becomes %25), and the server then reads the literal text "%20" instead of a space. If you see %25 in your output, you encoded one time too many.

Which characters never need encoding?

Unreserved characters: A–Z, a–z, 0–9, hyphen, underscore, period, and tilde. Everything else is either reserved (with a structural job in the URL) or must be percent-encoded.

Which characters need encoding

URLs permit only a limited alphabet. Letters, digits, and the four characters - _ . ~ never need encoding. Everything else falls into two camps: reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) that have special jobs in a URL, and everything else — spaces, accented letters, emoji — which is simply not allowed raw. Percent-encoding replaces such a character with a % followed by its two-digit hexadecimal code, so a space becomes %20 and & becomes %26.

The golden rule is to encode values, not whole URLs. Encoding https://example.com would mangle the :// that holds it together. Instead, encode each parameter value before inserting it:

Search text: fish & chips
Encoded value: fish%20%26%20chips
Full URL: https://example.com/search?q=fish%20%26%20chips

Common mistakes

Double encoding is the classic: encoding %20 again produces %2520 (the % itself encoded), and the server then searches for the literal text "%20". If you see %25 sequences where you expected spaces, encode once less. The plus sign is another trap: in HTML form data, + means a space, but in a URL path it is a literal plus — use %20 for spaces anywhere except form-encoded bodies. When decoding, a % not followed by two hex digits is malformed input and should be treated as an error, not guessed at.

Why do URLs contain %20 and other percent codes?

URLs may only contain a limited character set, so everything else — spaces, ampersands, question marks, non-English characters — is percent-encoded as a % followed by two hex digits. A space becomes %20, so “hello world” in a link reads “hello%20world”.

Your browser usually hides this by displaying the decoded text, but the encoded form is what actually travels over the network. When you copy a link from the address bar, you’re often copying the encoded version.

When do I need to encode a URL?

Whenever a value you put in a link contains reserved characters. Search queries with spaces, redirect URLs nested inside another URL’s parameters, and any non-ASCII text like accented characters all need encoding — otherwise the & or ? inside your value gets misread as URL structure and the link breaks.

If a shared link arrives mangled or truncated, paste it here and decode to see what it was supposed to be before re-encoding it correctly.

Embed this tool

Put this free url encoder & decoder on your own website or blog. Copy the code below and paste it into any page that accepts HTML — readers get the full working tool without leaving your site.

Powered by DailyToolHub

Related tools