Skip to main content
SimpleToolbox

URL Encoder

Encode and decode URLs and URI components with percent-encoding.

Inputs stay in your browser
Browser Based
Free to use now

URL Encoder / Decoder

Uses this browser's encodeURI / encodeURIComponent. Form mode encodes a space as + (application/x-www-form-urlencoded).

What is a URL encoder?

A URL encoder is a tool that percent-encodes or decodes URLs and URI components so reserved characters can travel in a query string. Paste a URL — this page does not shorten links or hit a network.

For example, a space becomes %20, an ampersand becomes %26, and an equals sign becomes %3D. This ensures query parameters and other URL components are transmitted correctly without being misinterpreted as structural URL characters.

How to Use the URL Encoder & Decoder

1

Paste your URL or text

Paste the URL, query parameter value, or raw text you want to encode or decode into the input field.

2

Choose Encode or Decode

Select whether you want to encode raw text into percent-encoded format, or decode a percent-encoded string back to readable text.

3

Copy the result

Click the copy button to copy the encoded or decoded output to your clipboard.

4

Use in your code or request

Paste the result directly into your API call, curl command, HTML href, or application code.

Common Encoded Characters

Alphanumeric characters (A-Z, a-z, 0-9) and a few unreserved characters (-, _, ., ~) remain untouched. Most other symbols are converted.

Character Description URL Encoded Form
SpaceSpace bar%20
!Exclamation mark%21
#Number sign / Hash%23
$Dollar sign%24
%Percent sign%25
&Ampersand%26
?Question mark%3F
=Equals sign%3D

Who Is This For?

  • Developers building URLs programmatically who need to encode query parameter values before appending them to an API endpoint or redirect URI.
  • QA engineers testing URLs with special characters — spaces, accented characters, or symbols — who need to verify the encoded form before running automated tests.
  • Anyone debugging a URL with unexpected percent-encoded characters — decode a mangled URL to quickly see what the original values were.

Key Benefits

  • Privacy. Tool inputs stay in the browser.
  • Free with no subscription — no account, no paywall, no usage limits.
  • No account required — open the page and start encoding immediately.
  • Encode and decode in one tool — switch between directions instantly without visiting a separate page.

Common URL Encoding Mistakes

  • Not encoding the path and query separately: Path segments and query string values have different reserved character sets. A slash / is valid in a path but must be encoded as %2F inside a query parameter value. Using encodeURI vs encodeURIComponent matters here.
  • Double-encoding already-encoded URLs: Encoding a URL that already contains %20 produces %2520 (the % itself gets encoded). Always decode first if you are unsure whether a URL is already encoded.
  • Forgetting that space encodes differently in paths vs query strings: In URL query strings, a space can be encoded as either + (HTML form encoding) or %20 (RFC 3986). In URL paths, only %20 is valid — + is treated as a literal plus sign.
  • Not handling Unicode characters: Non-ASCII characters (emoji, accented letters, CJK characters) must first be UTF-8 encoded, then each byte must be percent-encoded. Encoding the raw Unicode code point directly produces invalid URLs.

For encoding binary data to be embedded in URLs, the Base64 encoder with URL-safe mode produces compact output. When encoding text that will be inserted into HTML attributes alongside URL encoding, the HTML entity encoder handles the HTML layer separately.

Further reading: RFC 3986 — URI Syntax (IETF)

Common Use Cases

You are building an OAuth redirect URI and the callback URL contains colons and slashes. Encode the entire callback URL before appending it as a query parameter so the server receives it as a single value rather than parsing it as part of the URL structure.

You received a webhook payload where a URL parameter looks like search%3Fq%3Dhello%20world. Paste it into the decoder to instantly see the original value and understand what was sent.

You are writing a curl command in a shell script and the API key or token contains special characters. Encode it first to prevent the shell from misinterpreting the characters.

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent-encoding) is the process of converting characters that are not allowed in URLs into a safe format. Spaces, ampersands, equals signs, and other special characters are replaced with a percent sign followed by their hexadecimal code — a space becomes %20, an ampersand becomes %26. This ensures the URL can be transmitted correctly over the internet.

Is this tool free?

Yes. This URL Encoder is free to use now — ads are not live yet — with no account required. It runs in this tab. Tool inputs stay in your browser. The site uses aggregate Google Analytics.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and preserves structural characters like /, ?, #, and & because they are part of the URL structure. encodeURIComponent encodes a single value within a URL and encodes everything including those structural characters. Use encodeURIComponent for query parameter values — for example, when a parameter value itself contains an ampersand or equals sign.

Why does my URL have %20 in it?

Spaces are not allowed in URLs. When a browser or application encounters a space in a URL, it automatically encodes it as %20. This is standard behavior, not an error. If you are building a URL programmatically, always encode query parameter values before adding them to the URL string.

What happens if a URL is not encoded?

If a URL contains unencoded special characters like spaces or raw ampersands in a query parameter, the receiving server will likely misparse the request. It breaks the string at the first unencoded special character, resulting in a truncated payload, authentication failure, or HTTP 400 Bad Request error.

Which characters do not need to be URL encoded?

Alphanumeric characters (A-Z, a-z, 0-9) and four unreserved characters — hyphen -, underscore _, period ., and tilde ~ — are safe in URLs and do not need encoding. All other characters, including spaces, slashes, question marks, and equals signs, should be encoded when used as data values in query strings.

Disclaimer

This tool is provided for informational and educational purposes only. Results are not a substitute for professional advice.

Found this helpful?

Share this free utility with your network.

Free Tools Alert

Get new tools, templates, and calculators in your inbox. No fake subscriber counts.

No spam. One-click unsubscribe.