Developer Utilities

URL Encoder

All tools

Escape spaces, ampersands and non-ASCII characters so a value survives inside a URL.

How it works

Four simple steps

1

Paste raw text

Add strings with spaces, unicode, or reserved chars.

2

Choose encode mode

Encode full URI or component-only as needed.

3

Percent-encode

Unsafe bytes become %XX escape sequences.

4

Copy encoded URL

Paste into query params or fetch URLs safely.

URL Encoder

About URL Encoder

A campaign link carries a redirect target like https://shop.example/sale?ref=email&id=7 inside another URL's query string. Pasted as is, the inner & splits the outer parameter in two and visitors land on the wrong page. Encoding the inner value first keeps it in one piece.

Pick one of two modes. encodeURIComponent is the strict default: it escapes everything except letters, digits and - _ . ! ~ * ' ( ), which makes it right for a single query value, path segment or form field. encodeURI keeps the characters that give a URL its structure, such as : / ? # & and =, and escapes only spaces and characters that are never valid, which suits a complete link containing non-ASCII text. Both encode text as UTF-8, so é becomes %C3%A9.

Double encoding is the classic bug: run an encoded string through again and %20 turns into %2520. Encode each value once, when you build the URL, and leave it alone afterwards. Spaces become %20 here, not +, which matters if the receiving side expects HTML form encoding. To check the result, paste it into the URL decoder, and to assemble a link from separate parts, the URL builder encodes parameters for you.

Encoding uses the browser's built-in functions on the text in this tab. Tracking links, tokens and email addresses in your input are not sent anywhere.

Pair with: URL Decoder · URL Parser

Keyboard shortcut

Ctrl Enter - Run tool

Use cases

Query params

Escape search text and filters before appending to a URL.

Redirect targets

Encode destination URLs used as parameter values.

I18n paths

Percent-encode non-ASCII path segments safely.

Instructions

How to use this tool

FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

encodeURIComponent. The whole redirect URL is a single value inside another URL, so its own : / ? and & must be escaped. encodeURI would leave them alone and the outer URL would be parsed incorrectly.

Both JavaScript functions follow URI rules, where a space is %20. The + form comes from HTML form encoding (application/x-www-form-urlencoded). Most servers accept %20 in query strings, but a few form parsers only treat + as a space.

The text contains a lone surrogate, usually half of an emoji that was cut off while copying. JavaScript cannot encode that as UTF-8. Copy the original text again or delete the broken character.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools