Encoding 🔒 Runs in your browser — no data sent to servers

URL Encoder & Decoder

Percent-encode and decode URLs, query strings and parameters, in your browser.

Input
Output

URL Encoder and Decoder - Percent-Encode Text and Query Strings Online

A URL may only contain a limited set of characters. Everything else - spaces, accents, ampersands, slashes inside a value, emoji, Arabic or Japanese text - has to be percent-encoded before it can travel safely in a link, a query string or a form submission. This free URL encoder and decoder does that conversion instantly, in both directions, without sending anything to a server.

Paste your text and click Encode to get a safe, transport-ready string, or paste an encoded URL and click Decode to read it in plain language. A mode selector lets you switch between encodeURIComponent and encodeURI, which is the choice that decides whether your link works or silently breaks.

Diagram: “a b&c=é” encoded character by character into “a%20b%26c%3D%C3%A9”.CharacterUTF-8 bytesEncodeda61a␣20%20b62b&26%26c63c=3D%3DéC3 A9%C3%A9Kept as is: letters, digits, - _ . ~Escaped as %XX
Letters pass through unchanged. The space and the reserved characters & and = become %20, %26 and %3D, and é is first turned into its two UTF-8 bytes, C3 and A9, each written as %XX.

What is URL encoding?

URL encoding, also called percent-encoding, replaces an unsafe character with a percent sign followed by its hexadecimal byte value. A space becomes %20, a slash becomes %2F, a question mark becomes %3F. Characters outside ASCII are first converted to UTF-8 bytes and then encoded byte by byte, which is why a single accented letter often turns into two percent groups and an emoji into four.

encodeURIComponent or encodeURI - which mode do you need?

SituationModeWhy
Encoding one query parameter valueencodeURIComponentEscapes &, =, ?, / and # so the value cannot break out of its field
Encoding a path segment such as a slugencodeURIComponentKeeps a slash inside the value from creating a new path level
Cleaning up a complete URL you already haveencodeURILeaves the structural characters intact so the address stays a working URL
Building a redirect target passed inside another URLencodeURIComponentThe whole inner URL is a value, not a structure

How to encode or decode a URL

  1. Paste the text, parameter value or full URL into the input pane.
  2. Choose encodeURIComponent for a single value, or encodeURI for a whole address.
  3. Click Encode to percent-encode, or Decode to reverse it.
  4. Copy the output straight into your code, your browser bar or your API client.

Characters you will see most often

  • %20 - space. In older form submissions you will also see + used for the same purpose.
  • %2F - forward slash, encoded when it belongs to a value rather than to the path.
  • %3F and %26 - question mark and ampersand, the two characters that delimit query parameters.
  • %3D - equals sign, which separates a parameter name from its value.
  • %23 - hash, otherwise read as the start of a fragment identifier.
  • %2B - plus sign, which must be encoded or it may be interpreted as a space.

When you need a URL encoder

  • Building search, filter or pagination links where user input ends up in the query string.
  • Passing a return URL to an OAuth provider or a payment gateway as a redirect_uri.
  • Adding UTM campaign parameters that contain spaces or punctuation.
  • Reading a long tracking link from an email and decoding it to see where it actually points.
  • Debugging an API call where a parameter contains JSON, a timestamp or a signature.
  • Handling non-Latin slugs so a Persian, Japanese or Cyrillic title survives a copy-paste.

Mistakes that break links

  • Double encoding. Running an already encoded string through again turns %20 into %2520. Decode first, then encode once.
  • Encoding the whole URL with encodeURIComponent. The :// and the slashes get escaped and the address stops being a URL.
  • Confusing + and %20. Inside a query string a plus may mean a space; inside a path it means a literal plus.
  • Forgetting UTF-8. Legacy pages that encoded in ISO-8859-1 produce percent groups that a modern decoder cannot map back.
  • Trusting a decoded value. Decoding is not sanitising - validate input before using it in a query or in HTML.

Runs entirely in your browser

The encoder uses the browser's own JavaScript functions, so nothing is uploaded, stored or logged. That keeps signed URLs, session identifiers and customer parameters where they belong: on your machine.

URL encode in JavaScript, Python, PHP, Java and C#

LanguageEncode a valueNotes
JavaScriptencodeURIComponent(value)encodeURI for a whole address
Pythonurllib.parse.quote(value, safe='')quote_plus turns spaces into +
PHPrawurlencode($value)urlencode uses + for spaces
JavaURLEncoder.encode(value, "UTF-8")Produces + for spaces; replace with %20 inside a path
C# / .NETUri.EscapeDataString(value)HttpUtility.UrlEncode uses +
PowerShell[uri]::EscapeDataString($value)Same rules as .NET

Related tools

URLs and payloads travel together. Decode embedded binary with the Base64 encoder, read a token from a callback URL with the JWT decoder, format an API response with the JSON formatter, and test a matching pattern with the regex tester.

Guides