Developer ToolsEncoders & DecodersFree Tool

URL Encoder

Percent-encode text for safe use in URLs, or decode it back, using the native encodeURIComponent/decodeURIComponent functions.

How to Use URL Encoder
  1. 1Paste your text or URL component
  2. 2Select Encode or Decode
  3. 3Click Process
  4. 4Copy the result
About URL Encoder

What URL (percent) encoding is

URLs may only contain a limited set of characters. Anything else, including spaces, accented letters, emoji and symbols with a special meaning such as &, =, ?, # and /, must be written as a percent sign followed by the hexadecimal value of each UTF-8 byte. A space becomes %20, and é becomes %C3%A9. This tool encodes or decodes text with the browser's encodeURIComponent and decodeURIComponent functions, and you choose the direction.

Example

price=5 & tax=18% encodes to price%3D5%20%26%20tax%3D18%25. Decoding that string returns the original.

When to use it

  • Building query-string values that contain spaces, ampersands or non-English text.
  • Making a link to a search or redirect URL that itself contains a URL.
  • Reading a long percent-encoded link from a log, analytics report or email.
  • Debugging why a parameter is being cut off or mis-parsed on a server.

Encode the parts, not the whole URL

This function encodes reserved characters such as /, :, ? and &. That is exactly right for a value placed inside a query string, but if you paste an entire URL, its own slashes and colons will also be encoded and the link will no longer work. Encode each parameter value separately, then assemble the URL.

Details worth knowing

  • Spaces use %20, not +. The plus sign convention appears in HTML form submissions; browsers and servers usually accept both in query strings, but %20 is correct everywhere in a URL path.
  • Double encoding happens if you encode already-encoded text: %20 becomes %2520. If you see that pattern, decode once.
  • Decoding errors. A lone % that is not followed by two hex digits is invalid and cannot be decoded.
  • Not for security. Percent encoding does not protect or hide data.

Related tools: Base64 encoder, slug generator for clean URL slugs, and UTM builder for campaign links.

Frequently Asked Questions

Everything that JavaScript's native encodeURIComponent() encodes — spaces, &, ?, #, /, and other characters reserved in URLs — converted to their %XX percent-encoded form.

It uses encodeURIComponent, meant for individual URL components (a query parameter value, a path segment) — it will also encode characters like / and : that you might want preserved in a full URL. For encoding an entire URL while preserving its structure, encode only the specific parts that need it.

Yes — switch to the Decode tab to run decodeURIComponent instead.

No — encoding happens entirely in your browser.

Related Tools

More from Developer Tools