Skip to content
Q3.Labs, Home

Free Tool

URL Encoder & Decoder

Encode or decode URLs and URI components with standard percent-encoding, and choose between encoding a single value or a complete URL. Your URL or text is processed locally in your browser and is not uploaded to Q3 Labs.

  • Free
  • · No signup
  • · Nothing uploaded
  • · Unicode and emoji safe

Private by design. Your URL or text is processed locally in your browser and is not uploaded to Q3 Labs. URLs you enter are never opened or fetched.

Operation

Encoding type

Uses encodeURIComponent()

URI Component encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single value, such as one query parameter or path segment.

0 characters

Tip: press Ctrl+Enter (Cmd+Enter on Mac) to run.

Result

Encode or decode something to see the result details here.

Free URL encoder and decoder online

This tool percent-encodes and decodes text for use in URLs. Choose Encode or Decode, then choose what you're working with: a single URI Component (such as one query parameter value) or a Full URI. The tool shows exactly which JavaScript function it used, how the length changed, and warns about common mistakes such as double encoding.

Everything is treated as text. A URL you paste is never opened, fetched or checked online. To see what a live URL actually returns, use the HTTP Status Checker instead.

What is URL encoding?

URLs can only contain a limited set of ASCII characters, and some of those, such as ?, & and /, have special jobs. URL encoding lets you include anything else (spaces, symbols, other languages, emoji) and lets you use a special character as ordinary data without changing the URL's meaning.

What is percent encoding?

Percent-encoding is the mechanism defined in RFC 3986: a byte is written as % followed by its value in two hexadecimal digits. A space (byte 32, hex 20) becomes %20; an ampersand becomes %26. "URL encoding" and "percent encoding" describe the same thing.

How URL encoding works

  1. Characters that are safe as they are stay unchanged: letters, digits and a few symbols like - _ . ~
  2. Everything else becomes bytes. The character is converted to UTF-8: one byte for ASCII, two to four for other scripts and emoji.
  3. Each byte is written as %XX in hexadecimal. So é becomes %C3%A9 and 🚀 becomes %F0%9F%9A%80.
  4. Structural characters depend on context. Whether / or & is encoded depends on whether it's part of the URL's structure or part of the data.

URL encoding vs URL decoding

Encoding turns text into its URL-safe form, for example before you put a search term into a link. Decoding turns percent-encoded text back into readable characters, for example to read a value from a link or a server log. For valid input they are exact opposites: decoding what you encoded gives back the original, which you can check with the tool's Swap button.

encodeURI vs encodeURIComponent

JavaScript has two pairs of built-in functions, and they exist for different jobs:

  • encodeURIComponent() / decodeURIComponent() handle one piece of a URL. They encode the structural characters too, so the piece can't break the URL it goes into. This is the URI Component mode.
  • encodeURI() / decodeURI() handle a complete URL. They leave its structure alone and only encode what can never appear literally, such as spaces. decodeURI() also deliberately keeps escapes like %2F and %3F, so decoding can't change the URL's structure. This is the Full URI mode.

Here is the same URL through both:

A complete URL encoded with encodeURI and encodeURIComponent
FunctionResult for https://example.com/search?q=hello world&lang=en
encodeURIhttps://example.com/search?q=hello%20world&lang=en
encodeURIComponenthttps%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

The first is still a working link; only the space was encoded. The second encoded the :, /, ?, = and & as well. That is correct if this whole URL is being passed as a value inside another URL (for example ?redirect=…), and wrong if you just wanted a usable link.

When should you encode a URL component?

  • Query parameter values built from user input, search terms or data.
  • Query parameter names if they can contain anything beyond letters and digits.
  • Path segments built from data, such as a product name, so a / in the data doesn't create a new folder level.
  • A whole URL passed as a value, such as a redirect or share target.

Don't encode a whole, already-structured URL with component encoding, and don't encode a value twice. Build the URL from encoded pieces instead. If you're building campaign links, the UTM Builder encodes each parameter for you.

How to encode query parameters

Encode each value on its own, then assemble the URL. For the search term hello world & SEO:

  1. Encode the value with URI Component mode: hello%20world%20%26%20SEO
  2. Add it after the parameter name: https://q3labs.co/search?q=hello%20world%20%26%20SEO

Because the & became %26, the server reads the whole phrase as the value of q. Left unencoded, & SEO would look like the start of a second parameter. Encoding https://q3labs.co/search?q=hello world as a whole with Full URI gives https://q3labs.co/search?q=hello%20world, which only fixes the space.

URL encoding examples

These results are produced by the same code the tool above uses.

Text encoded as a URI component and as a full URI
ExampleInputURI ComponentFull URI
Spaceshello worldhello%20worldhello%20world
Ampersand and equalsa&b=ca%26b%3Dca&b=c
Reserved characters: / ? # [ ] @%3A%20%2F%20%3F%20%23%20%5B%20%5D%20%40:%20/%20?%20#%20%5B%20%5D%20@
Plus and percent1+1 = 100%1%2B1%20%3D%20100%251+1%20=%20100%25
Hindiनमस्ते दुनिया%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20%E0%A4%A6%E0%A5%81%E0%A4%A8%E0%A4%BF%E0%A4%AF%E0%A4%BE%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20%E0%A4%A6%E0%A5%81%E0%A4%A8%E0%A4%BF%E0%A4%AF%E0%A4%BE
Arabicمرحبا بالعالم%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%20%D8%A8%D8%A7%D9%84%D8%B9%D8%A7%D9%84%D9%85%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%20%D8%A8%D8%A7%D9%84%D8%B9%D8%A7%D9%84%D9%85
Japaneseこんにちは%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF
Emoji🚀 Q3 Labs%F0%9F%9A%80%20Q3%20Labs%F0%9F%9A%80%20Q3%20Labs

Spaces, plus signs and %20

In percent-encoding a space is always %20, and that is what encodeURIComponent() and encodeURI() produce. You will also see + used for spaces. That comes from a related but different format, application/x-www-form-urlencoded, which HTML forms and URLSearchParams use for query strings.

  • In a query string, most servers read both + and %20 as a space.
  • In a path, + is just a plus sign, so %20 is the safe choice.
  • A literal plus sign in a value must be encoded as %2B, or a form-style decoder will turn it into a space.

This tool follows the URI standard, so it never turns spaces into + and never decodes + as a space.

Reserved characters in URLs

The URI standard reserves these characters for structure: : / ? # [ ] @ separate the main parts of a URL, and ! $ & ' ( ) * + , ; = are available as delimiters within them. A reserved character doesn't always have to be encoded. It depends on its role: the ? that starts a query string must stay as it is, while a ? inside a search term must be encoded. Here is what each function does with them:

Reserved characters encoded as a URI component and as a full URI
CharacterencodeURIComponentencodeURI
:%3A: (unchanged)
/%2F/ (unchanged)
?%3F? (unchanged)
#%23# (unchanged)
[%5B%5B
]%5D%5D
@%40@ (unchanged)
!!! (unchanged)
$%24$ (unchanged)
&%26& (unchanged)
''' (unchanged)
((( (unchanged)
))) (unchanged)
*** (unchanged)
+%2B+ (unchanged)
,%2C, (unchanged)
;%3B; (unchanged)
=%3D= (unchanged)

encodeURIComponent also leaves ! ' ( ) * unchanged, as the JavaScript specification defines, so strict RFC 3986 encoders may differ on those five characters.

URL encoding and Unicode

URLs are ASCII, so other characters are converted to UTF-8 bytes and each byte is percent-encoded. That is why one character can become a long run: न is %E0%A4%A8 (three bytes), and the rocket emoji is %F0%9F%9A%80 (four). Decoding reverses it exactly. Browsers often display the decoded form in the address bar while sending the encoded one.

If a decoder reports invalid UTF-8, a multi-byte character was usually cut off (for example %E0%A4 without its last byte), or the value was encoded with an old single-byte character set. This tool reports that instead of returning corrupted text.

Common URL encoding mistakes

  • Component-encoding a whole URL, which turns https:// into https%3A%2F%2F and breaks the link.
  • Double encoding: encoding an already-encoded value turns %20 into %2520. The tool warns when this looks likely.
  • Not encoding values at all, so an & or # in the data cuts the value short.
  • A literal % that isn't encoded, such as 100%, which decoders reject. Write it as 100%25.
  • Mixing + and %20 between form-style and URI-style code.
  • Treating encoding as security. Encoded values are trivially readable, and decoded input is still untrusted. URL encoding isn't encryption.

For payloads that need to carry binary data, see the Base64 Encoder & Decoder. Building links and redirects correctly also matters for SEO hygiene: an On-Page SEO Checker can confirm a page's canonical and links look right.

Frequently Asked Questions

Explore more

Encode binary data or text for APIs with the Base64 Encoder & Decoder, turn page titles into clean URLs with the Slug Generator, format or shrink JSON with the JSON Formatter and JSON Minifier, and build tracked campaign links with the UTM Builder. Check a live URL with the HTTP Status Checker, generate a sitemap with the XML Sitemap Generator, and count or reformat text with the Character Counter and Case Converter. Browse all our free tools.

Related tools & resources

Related tools

  • Password GeneratorGenerate strong random passwords in your browser with custom length and character types. Nothing is uploaded.
  • UUID GeneratorGenerate random UUID v4 identifiers in bulk, copy or download them, and validate a UUID, all in your browser.
  • Favicon GeneratorGenerate favicon and web app icon files from your logo directly in your browser.

Learn more

  • Web Development GuidesPlatform choice, launch sequencing, and the technical fundamentals every website needs before it goes live.
  • Web DevelopmentSlow, hard-to-maintain websites quietly cap growth by hurting Core Web Vitals, SEO, and conversion rate.

Related articles

We use cookies for analytics to understand site usage. Privacy Policy