🧰 ToolPicoAll Tools →

URL Encode / Decode

Encode text with encodeURIComponent/encodeURI, decode a percent-encoded string, parse or build a query string, break a full URL into its parts — plus Base64 encode/decode and a tracking-parameter cleaner. Everything runs in your browser, nothing is sent to a server.

6 modes in one tool 100% client-side Standard: RFC 3986 Updated: Jul 19, 2026
📄
Drag a .txt file here to encode it or click to choose a file — output can be downloaded when done
Accented characters, emoji, and special symbols are all supported. You can also drop a .txt file above instead of pasting text.
Form encoding (+ for space)application/x-www-form-urlencoded style: "+" instead of %20
📄
Drag a .txt file here to decode it or click to choose a file — output can be downloaded when done
Paste a %XX percent-encoded string, or an entire encoded URL. You can also drop a .txt file above instead of pasting text.
Multi-layer (nested) decodeResolves double-encoded values like %2520 through every layer
Each line is processed independently; results come back in the same order. Ideal for encoding/decoding dozens of links or parameters at once and copying them all together.
Parameters are automatically decoded; known tracking parameters (UTM/gclid/fbclid) are flagged.
Leave this blank to generate only a ?key=value query string.
Breaks a URL into protocol, host, port, path, query, and fragment (hash) — plus subdomain/domain/TLD, directory/filename/extension, and any embedded username/password.
Quick answer URL encoding (percent-encoding) converts characters that can't appear in a URL — spaces, accented letters, emoji, and reserved symbols like &, ?, and # — into a safe %XX format. encodeURIComponent() encodes a single parameter value; encodeURI() encodes a whole address. decodeURIComponent() reverses either one.
UTF-8Character encoding standard
RFC 3986URI percent-encoding standard
%20Percent-code for a space
FreeUnlimited, no sign-up
⚙️ Privacy note: All encoding, decoding, and parsing happens directly in your browser (client-side JavaScript). The text or URL you enter is never sent to a server, stored, or logged. The "Share" button only encodes your input into a link if you choose to use it — think about who you're sharing that link with before including anything sensitive.

What is URL encoding, and how does it work?

A complete guide to percent-encoding, the difference between encodeURIComponent and encodeURI, query strings, and Base64.

A URL can only carry a limited set of characters directly — letters, digits, and a handful of unreserved symbols. Spaces, accented letters (like é, ü, ñ), emoji, and & ? # % + = — the reserved characters that give a URL its structure — must first be converted to %XX form, a process called percent-encoding or, more commonly, URL encoding. The reverse operation is URL decoding. The tool above handles both directions, plus query string parsing/building, full URL parsing, and Base64, all instantly in your browser.

What's the difference between encodeURIComponent and encodeURI?

Quick answerencodeURIComponent() encodes a SINGLE piece of a URL — for example one query value — and also encodes structural characters like & = ? / : #, which is why it's the right choice for parameter values. encodeURI() is for encoding an ENTIRE address; it leaves the characters a URL needs to function — : / ? # & = — untouched.
  • encodeURIComponent("a&b=c")a%26b%3Dc (& and = are also encoded — correct for a single parameter VALUE)
  • encodeURI("https://x.com/a b?c=1&d=2")https://x.com/a%20b?c=1&d=2 (only the space is encoded; the URL structure is preserved)

How are accented characters and emoji encoded in a URL?

Quick answerBrowsers use UTF-8 encoding for URLs. Each accented letter or emoji is first converted to UTF-8 bytes, then each byte is written as its own %XX value. For example, é is 2 bytes and becomes %C3%A9; a 4-byte emoji becomes four separate %XX groups. You never need to calculate this by hand — encodeURIComponent() does it automatically.
Common characters and their percent-encoded form (UTF-8)
CharacterMeaningEncoded form
(space)Space character%20 (or + in forms)
éAccented letter, e.g. café%C3%A9
üAccented letter, e.g. Zürich%C3%BC
&Parameter separator%26
=Key-value separator%3D
?Start of the query string%3F
#Start of the fragment/anchor%23
%The percent sign itself%25
🚀Emoji (4-byte UTF-8)%F0%9F%9A%80

How do you build and parse a query string?

Quick answerA query string is the set of key=value pairs that follow the ? in a URL, separated by &. The "Build Query" tab above lets you enter key-value pairs and generates a correctly percent-encoded query string; the "Parse Query" tab takes an existing URL and turns every parameter into a readable table. The tool also automatically flags well-known tracking parameters like utm_source, gclid, and fbclid.

How is Base64 encoding different from URL encoding?

Quick answerBase64 converts any binary or text data into a 64-character alphabet (A-Z a-z 0-9 + /); it's commonly used for tokens, API keys, or embedding small files as text, and has nothing to do with URL structure. URL encoding specifically makes special characters inside a URL safe. Because Base64 output contains + and /, it sometimes needs an additional pass of encodeURIComponent() before it can go into a URL parameter — try both in the mini tools section below.

Popular URL encoding & decoding examples

Common conversions you can open directly — each one pre-fills the tool above with the right mode and input.

Mini tools: Base64, Query → JSON, URL Cleaner

Three small helpers frequently needed alongside URL encode/decode — all run in your browser.

🔤Base64 Encode/Decode
Convert text to Base64, or Base64 back to text (Unicode-safe).
🧩Query String → JSON
Paste a query string or URL, convert its parameters into a JSON object.
🧹URL Cleaner
Strip UTM, gclid, fbclid, and similar tracking parameters to get a clean link.

Reference tables & practical facts

Citable RFC 3986 character classes, an encodeURI vs. encodeURIComponent comparison, and common tracking parameters.

RFC 3986 — unreserved and reserved characters
ClassCharacters
Unreserved (never encoded)A-Z a-z 0-9 - _ . ~
General delimiters (gen-delims): / ? # [ ] @
Sub-delimiters (sub-delims)! $ & ' ( ) * + , ; =
Everything elseAlways percent-encoded (spaces, accented letters, emoji, non-ASCII bytes, etc.)

Source: RFC 3986 (Uniform Resource Identifier — Generic Syntax), IETF.

Characters each JavaScript encoding function leaves alone
FunctionLeaves unencoded
encodeURIComponent()A-Z a-z 0-9 - _ . ! ~ * ' ( )
encodeURI()The above, plus ; / ? : @ & = + $ , #
decodeURIComponent()Decodes %XX sequences; throws a URIError on an invalid sequence

Rule of thumb: use encodeURIComponent for a single parameter VALUE, and encodeURI for a complete URL.

Common tracking query parameters
ParameterSource / meaning
utm_source, utm_medium, utm_campaignGoogle Analytics campaign tags
utm_term, utm_contentKeyword / ad-variant tags
gclidGoogle Ads click identifier
fbclidMeta (Facebook/Instagram) click identifier
msclkidMicrosoft Ads (Bing) click identifier
mc_cid, mc_eidMailchimp email campaign identifier
igshid, ref_src, refInstagram / general referral tags

The "Parse URL" tab and "URL Cleaner" mini tool above automatically recognize and flag/remove these parameters.

Add this tool to your site (embed code)

Embed the URL encode/decode tool on your own website for free. Copy the code below into your HTML — the tool runs in a simplified view and links back to this page as its source.

The embedded tool has a fixed layout; you can adjust the height value to fit your site. No ads or personal data, runs entirely client-side.

URL & encoding terms glossary

Short definitions of the core concepts used in URL encoding and decoding.

URI / URLA URI is the general format for identifying a resource; a URL (Uniform Resource Locator) is the most common type of URI, one that also says how to find the resource.
Percent-encodingThe method of representing reserved or non-ASCII characters as %XX (hexadecimal byte) sequences; synonymous with URL encoding.
Reserved / unreserved charactersUnder RFC 3986, unreserved characters (letters, digits, - _ . ~) are never encoded; reserved characters (: / ? # & = etc.) carry the URL's structure.
Query stringThe key=value parameters that follow the "?" in a URL, separated by "&".
Fragment / hash (#)The part of a URL after "#"; it's never sent to the server and is used for in-page navigation or client-side state.
encodeURIComponent()A JavaScript function that encodes a single URL component (a parameter value), also encoding structural characters.
encodeURI()A JavaScript function that encodes an entire URL while leaving the characters the URL's structure needs untouched.
Double / nested encodingEncoding an already-encoded string a second time; seeing "%25" (the code for a literal percent sign) is usually a sign of this.
Base64A general-purpose encoding that represents binary or text data with a 64-character alphabet, independent of URL structure.
UTM parametersGoogle Analytics-derived tags — utm_source, utm_medium, utm_campaign, etc. — added to a query string to track marketing campaigns.
PunycodeA separate encoding that converts internationalized domain names into ASCII; distinct from URL encoding, and used only for hostnames.
application/x-www-form-urlencodedThe default submission format for HTML forms; it encodes a space as "+" instead of %20.

In-depth guides

Detailed answers to the most common URL encoding questions.

My accented characters look garbled when I share a URL — what should I do?

When accented characters are added to a URL unencoded (as raw UTF-8 bytes), some apps, messaging platforms, or older systems can misinterpret them, producing garbled text (mojibake). The fix is to encode the text with encodeURIComponent() before sharing it: a word like "café" becomes "caf%C3%A9" and gets correctly decoded on the receiving end.

Paste your text into the "Encode" tab above and choose "Full URI" mode to keep the whole address structure intact while only encoding the problematic characters; then use the result directly in your browser's address bar or share it as a link.

What should I watch for when reading query string parameters?

When inspecting a query string, first split it into parameters at each &, then split each parameter into key and value at =; values are usually percent-encoded, so you'll need to decode them to make them readable. Also keep in mind that parameters like utm_*, gclid, and fbclid aren't functional data — they're marketing tracking tags, and you may want to remove them before sharing a link.

The "Parse Query" tab above does this parsing automatically and highlights tracking parameters in amber; the "URL Cleaner" mini tool removes them with a single click.

Which encoding should I use when calling an API?

When sending a query parameter to a REST API, always encode the value with encodeURIComponent() — especially if it contains spaces, "&", or accented characters — because that value is only a COMPONENT of the URL. If you're sending JSON in the request body, no additional encoding is needed, since JSON has its own escaping rules. Only use encodeURI if you're encoding an entire, already-built URL in one pass; otherwise you risk encoding necessary characters like "?" and "&" and breaking the request.

Frequently asked questions

What is URL encoding?
URL encoding (percent-encoding) converts characters that can't be used directly in a URL — spaces, accented letters, reserved symbols like & ? #, and emoji — into the %XX format browsers understand. For example, a space becomes %20, and "é" becomes %C3%A9. This lets text be added safely to an address or parameter without breaking the URL's structure.
How do you URL-encode text?
In a browser, use JavaScript's encodeURIComponent() or encodeURI() functions, or an online tool like this one. Paste your text into the "Encode" tab, choose a mode, and click Encode; then copy the result and add it to a URL or query parameter.
What is encodeURIComponent?
encodeURIComponent() is a JavaScript function used to encode a SINGLE piece of a URL (a query value, a parameter); it also encodes structural characters like & = ? / :. If you're encoding one VALUE rather than a complete address, this is the right function.
How do you build a query string?
A query string is the key=value pairs that follow the "?" in a URL, joined with & (e.g. ?color=red&size=42). Enter your key-value pairs in the "Build Query" tab and click Build; the values are automatically and correctly encoded into a complete query string or full URL.
How are accented characters encoded in a URL?
Modern browsers use UTF-8 in URLs; each accented character is converted into a 2-byte %XX%XX sequence (e.g. "é" → %C3%A9). encodeURIComponent() and encodeURI() handle this conversion automatically and correctly.
What is Base64 encode/decode?
Base64 is a general binary-to-text encoding that represents data with a 64-character alphabet (A-Z, a-z, 0-9, +, /); it's used for tokens, images, or embedding small files. It's different from URL encoding, which specifically encodes special characters inside a URL. Try both in the mini tools section above.
What is URL decoding, and how do you do it?
URL decoding converts a %XX percent-encoded string back to its original, readable text; it's the reverse of encoding. Paste the encoded text into the "Decode" tab and click Decode; for text encoded more than once (nested), the "multi-layer decode" option resolves every layer in one step.
Why do I sometimes see a double-encoded value like %2520?
%2520 results from encoding an already-encoded %20 (a space) a second time, because "%" itself is encoded as %25. It's usually caused by a system encoding the same data twice by mistake. The "multi-layer decode" option in the "Decode" tab resolves every nested layer back to the original text in one pass.
Can I encode or decode many URLs at once (in bulk)?
Yes. Paste one piece of text or URL per line into the "Bulk" tab, choose the operation (encodeURIComponent, encodeURI, or decode), and click Run; each line is processed independently and results come back in the same order. This lets you process dozens of links or parameters at once instead of one at a time. Everything runs in your browser — no line is ever sent to a server.
Can the URL parser show me the subdomain, domain, and file extension separately?
Yes. The "Parse URL" tab breaks the hostname into subdomain, domain, and TLD (e.g. cdn.assets.example.co.uk → subdomain "cdn.assets", domain "example", TLD "co.uk"), and breaks the path into directory, filename, and extension. If the URL contains a username or password (userinfo), those are shown separately with a security warning, since credentials embedded in a URL are not safe to share.
Can I encode or decode a whole text file instead of pasting text?
Yes. On the "Encode" or "Decode" tab, drag a .txt file onto the drop zone above the text box (or click it to choose a file) — its contents load straight into the box. After running Encode or Decode, a "Download result as .txt" button appears so you can save the output as a new file. The file never leaves your browser.

Methodology & sources

ToolPico's URL Encode / Decode tool is a free, independent tool. Encoding and decoding are performed directly with the browser's built-in encodeURIComponent() / encodeURI() / decodeURIComponent() functions (UTF-8 based, RFC 3986 compliant); URL parsing uses the URL() Web API, and Base64 conversion uses a UTF-8-safe wrapper around btoa()/atob(). No computation is ever sent to a server.

Sources: RFC 3986 (Uniform Resource Identifier — Generic Syntax, IETF) · WHATWG URL Standard · MDN Web Docs (encodeURIComponent, encodeURI, URL). Last updated: July 19, 2026. Results are for informational purposes only.

🔗 Add this tool to your site

Copy the code below into your own site. The tool is free, always up to date, and runs entirely on your page. No sign-up required.

Preview →
⚡ Built with ToolPico · toolpico.com