IT Tool

Free URL Encoder & Decoder Online

Percent-encode a URL or query value and decode it back, with a choice of encodeURI or encodeURIComponent scope — all in your browser.

Instant 100% Client-Side No Login
PROCESSINGLOCAL
LIMITNONE
PRIVACYBROWSER-ONLY
Scope:

Encodes every reserved character — use for a single query value or path segment.

Raw Text

Encoded URL

Percent-encoding is a translation layer, not a cipher

A URL travels as a stream of US-ASCII characters, a rule fixed by RFC 3986, the 2005 standard that superseded RFC 2396 from 1998 and the original RFC 1738 from 1994. Only a small alphabet may appear literally: the 26 letters A to Z, the 26 letters a to z, the 10 digits 0 to 9, and the 4 marks hyphen, period, underscore, and tilde. RFC 3986 names these 66 symbols the unreserved set, and they pass through untouched. Everything else is either a reserved character with a structural job or a byte with no business appearing raw, and both get rewritten by percent-encoding: a % sign followed by 2 hexadecimal digits spelling the byte value from 0 to 255. A space at decimal 32 turns into %20, an ampersand at 38 into %26, an equals sign at 61 into %3D, a slash at 47 into %2F, a question mark at 63 into %3F, a hash at 35 into %23, a plus at 43 into %2B, and a colon at 58 into %3A. A character above code point 127 is first split into UTF-8 bytes, then each byte is escaped in turn: the em dash, U+2014, expands to the 3-triplet run %E2%80%94, the euro sign U+20AC to %E2%82%AC, the letter é at U+00E9 to the 2-byte %C3%A9, and the emoji U+1F600 to a 4-byte %F0%9F%98%80. Decoding walks the reverse map, reading each %XX back into 1 byte and reassembling the multi-byte runs into characters.

The mistake that breaks real query strings is treating every symbol as safe. The 18 reserved characters in RFC 3986, split into gen-delims and sub-delims, do structural work. The gen-delims most seen in a query, the ampersand %26 and equals sign %3D, separate 1 parameter from the next and split a key from its value; the question mark %3F opens the query, the hash %23 marks the fragment, the slash %2F divides path segments, and the colon %3Aends the scheme after the 5 letters of https. When a user types a value holding an ampersand, say the company AT&T, and you paste it into a query string unescaped, the parser reads that ampersand as a separator and shatters your 1 value into 2 broken parameters. Escaping it to %26 defuses the character: the receiving server turns %26 back into a literal ampersand inside the value and never confuses it for syntax. That is the whole job of percent-encoding, letting data carry bytes that would otherwise be parsed as grammar.

encodeURI keeps a URL whole; encodeURIComponent takes it apart

JavaScript ships 2 encoders, and picking the wrong 1 is the single most common bug this tool exists to fix. encodeURIComponent, the Component scope above, targets 1 piece of a URL: a single query value, 1 path segment, a fragment. It escapes all 18 reserved characters, the slash %2F, question mark %3F, ampersand %26, equals sign %3D, hash %23, and colon %3A among them, because inside a lone value none of those should keep structural meaning; it spares only 11 extra marks beyond the unreserved 66, among them the exclamation point at 33, the 2 parentheses at 40 and 41, the asterisk at 42, and the apostrophe at 39. encodeURI, the Full URL scope, assumes an entire assembled address and preserves the structural set colon %3A, slash %2F, question mark %3F, hash %23, ampersand %26, and equals %3D so the URL stays valid. The break is concrete: feed a complete https:// address through encodeURIComponent and its slashes mutate into %2F, collapsing the string into 1 unusable blob; feed a raw value through encodeURI and any ampersand or equals hiding inside it survives to corrupt the surrounding query. Reach for Component scope when assembling 1 parameter, Full scope when you already hold a finished URL needing only its spaces and non-ASCII cleaned. Neither routine touches the 66 unreserved symbols, so hyphens at %2D, periods at %2E, underscores at %5F, and tildes at %7E read identically on both sides.

Spaces, plus signs, and the form-encoding trap

A space reaches a server 2 different ways, and the pair is not interchangeable. Inside the path and query of an ordinary URL the blank is %20, exactly what encodeURI and encodeURIComponent both emit. But an HTML form posted as application/x-www-form-urlencoded follows the older CGI convention where a space collapses to a + and a literal plus escapes to %2B, a behaviour now pinned by the WHATWG URL Living Standard. That is why a value pulled from a form body shows + where you expected %20. decodeURIComponent has never known the form rule: give it a + and it hands back a +, not a space, because under strict RFC 3986 the plus is an ordinary character carrying hex 2B. Decoding a form payload therefore means swapping + for space yourself, or replacing %2B first, before you decode the rest. Blending the 2 conventions is a routine source of names surfacing with plus signs jammed between the words.

What this tool does, and where it stops

Every operation here runs inside your browser through the native encodeURI, encodeURIComponent, and decodeURIComponent functions, so no URL, token, or query string leaves the tab or gets logged. Encode mode exposes both scopes so you can fit the function to the job; decode mode unwinds either 1, since decodeURIComponent reads back any %XX triplet either encoder wrote. The swap button pushes the output back in as input, letting you round-trip a value across all 3 functions and confirm it survives byte for byte. Decoding is where faults show: a % not trailed by 2 hex digits, or a triplet run that is not valid UTF-8, throws a URIError, and the tool surfaces that instead of returning a half-decoded string. What it cannot decide is whether your encoding suits its destination, because that hinges on which of the 5 URL components, scheme, authority, path, query, or fragment, the value lands in and whether the receiver wants RFC 3986 percent-encoding or form-style plus-encoding. Encoding makes a byte safe to transmit; it never makes an untrusted value safe to trust, so a decoded string still needs validation before it reaches a database, a shell, or an HTML page.

How to Use

1

Choose Encode or Decode.

2

When encoding, pick a scope: Component (encodeURIComponent) for a single value, or Full URL (encodeURI) for a whole address.

3

Paste your text or URL into the input box — the result updates as you type.

4

Click Copy Result, or use the swap button to feed the output back in and round-trip it.

Features

Encode with encodeURIComponent (value scope) or encodeURI (full-URL scope)
Decode any percent-encoded string with decodeURIComponent
Handles Unicode by encoding each UTF-8 byte to its own %XX triplet
Swap button chains encode and decode to verify a round-trip
100% client-side — no URL, token, or query string leaves your browser

Common Questions

About URL Encoder / Decoder

Percent-encode text for safe transmission in a URL, choosing Component scope (encodeURIComponent) for a single query value or Full URL scope (encodeURI) for a whole address, then decode any percent-encoded string back with decodeURIComponent. Handles Unicode by escaping each UTF-8 byte to its own %XX triplet, follows RFC 3986, and runs entirely in your browser.

Also known as: url encode, url decode, percent encoding, encode url, urlencode, urldecode, encodeuricomponent, encodeuri, decodeuricomponent, escape url, unescape url, query string encoder, %20 encoder, uri encode.

Processing Note

URL Encoder / Decoder runs in your browser, so the input you enter is processed locally on this page and is not uploaded to a ToolMintX account.

Tool Limits

IT tools provide quick diagnostics and transformations. They cannot see every private network, deployment setting, proxy, firewall, or production edge case.

Explore More