URL Encode Online

Encode text into URL-safe format instantly. Convert special characters, spaces, and unicode to percent-encoded values for use in URLs and query strings.

Options

What It Does

URL encoding, also called percent-encoding, rewrites characters that are unsafe or reserved in a web address into a percent sign followed by two hexadecimal digits — a space becomes %20, an ampersand becomes %26, a question mark becomes %3F. It exists because a URL has structure: characters like ?, &, =, # and / mark where the query, parameters and fragment begin. If a value you drop into a URL contains one of those characters literally, it gets mistaken for structure and the link breaks. Encoding turns the literal character into harmless data. There are two scopes: encodeURIComponent escapes everything and is meant for a single value like one query-string parameter, while encodeURI leaves URL structure intact and is meant for a whole address. Encoding is fully reversible and offers no security.

When to Use It

  • You are building a query string by hand and need to insert a value that may contain spaces, ampersands or equals signs without breaking the parameter boundaries.
  • You are wiring up an API request or webhook and a path segment or parameter contains characters like /, ? or # that must be escaped first.
  • You have a full URL with spaces or unicode characters and want to make it valid without disturbing its :, / and ? structure.
  • You are debugging a link that silently truncates or sends the wrong data, and you suspect an unescaped reserved character is being read as URL syntax.

Worked Examples

Hello World! price=$10 & name=John

A plain phrase with spaces and special characters. With component encoding the space becomes %20, the & becomes %26 and the = becomes %3D, so the whole thing is safe to use as one value. Toggle 'spaces as +' to see %20 switch to the + form used in form data.

https://example.com/search?q=cats and dogs#top

A full URL. Use encodeURI (the 'whole URL' mode) here: it escapes only the unsafe space to %20 while leaving the :, //, ?, = and # structure intact, so the link still works. encodeURIComponent would wrongly escape the slashes and question mark too.

filter=color=red&size=large

A value that itself contains & and = characters. This MUST be component-encoded — & becomes %26 and = becomes %3D — otherwise the receiving server reads the inner & as a new parameter separator and splits your single value into three.

Features

Real-time URL encoding as you type
Encode spaces as %20 or + option
Full Unicode support for international characters
Encode entire string or only special characters
Copy encoded result with one click
Character count for input and output
Works entirely in your browser
No data sent to any server

How to Use

1. Type or paste your text in the input area. 2. The encoded result appears instantly below. 3. Choose encoding options: spaces as %20 or +. 4. Click Copy to copy the encoded result. 5. Click Clear to reset.

Common Mistakes

  • Using encodeURI when you need encodeURIComponent. encodeURI keeps &, =, ?, / and : literal, so a single query-string value that contains those characters stays unescaped and corrupts the URL. For one parameter value, always use component encoding.
  • Double-encoding. Running already-encoded text through the encoder again turns each % into %25, so %20 becomes %2520. The link then decodes to the wrong text. Encode raw input exactly once.
  • Confusing + with %20. A literal + in a path means a plus sign, but in form-encoded query data it means a space. If you choose 'spaces as +' for something that is not form data, the space may be misread.
  • Assuming encoding hides data. Percent-encoding is fully reversible and offers zero security — never use it to conceal tokens, keys or personal information.

Frequently Asked Questions

All encoding happens locally in your browser. No data is sent to any server. Your text remains completely private.

Explore related topics

#Utilities #URL