HTML Encode Convert HTML entities Slug Generator Convert text to URL slug Find & Replace Search & replace in bulk
Mode
Common encoded chars
%20 — space
%26 — &
%3D — =
%3F — ?
%2F — /
%3A — :
%40 — @
%23 — #
How It Works
  1. 1Choose Encode or Decode mode in the left panel.
  2. 2Paste your text or URL into the Input box.
  3. 3The result appears instantly in the right box.
  4. 4Use ⇅ Swap to flip input/output, then copy.

What is URL Encoding?

URL encoding — also called percent-encoding — is a method defined in RFC 3986 for representing characters that are not allowed or that have special meaning inside a URL. Every unsafe character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20, an ampersand becomes %26, and a hash becomes %23.

URLs can only contain a limited set of ASCII characters. Everything outside that set — including spaces, special punctuation, characters from other languages, and emoji — must be encoded before being placed in a URL. Without encoding, browsers and servers may misinterpret the URL, break the query string, or return an error.

A common point of confusion: why do you sometimes see spaces as + instead of %20? The + convention comes from the older application/x-www-form-urlencoded format used in HTML forms. It only applies inside query strings. In the path segment of a URL, %20 is the only correct representation. Our URL encoder always uses %20 (via encodeURIComponent) for maximum cross-system compatibility.

Your text never leaves your browser. All encoding and decoding happens locally in JavaScript — nothing is sent to any server.

How to Use This URL Encoder & Decoder — Step by Step

  1. Choose your mode: Click the Encode tab to convert plain text or a raw URL into a percent-encoded string, or click Decode to convert a percent-encoded URL back into readable text.
  2. Paste your input: Type or paste your text into the left input box. The result appears in the right box instantly — no button click needed.
  3. Copy the result: Click Copy result to copy the output to your clipboard with one click.
  4. Swap directions: Use the Swap button to move the output back into the input field — useful when you want to re-encode or further process the result.
  5. Clear and start over: Hit Clear to reset both fields.

URL Encoding Examples

The table below shows the most common characters that require encoding, along with their percent-encoded equivalents and practical examples.

OriginalEncodedNotes
hello worldhello%20worldSpace → %20 (universal, not +)
&%26Ampersand — separates query params; must be encoded in values
=%3DEquals sign — key=value separator in query strings
#%23Hash — marks a fragment; browsers stop sending the rest to the server
?%3FQuestion mark — starts the query string; encode it in values
@%40At sign — used in email and authentication URIs
ą ę ó (Polish)%C4%85 %C4%99 %C3%B3Multi-byte UTF-8 characters each encode to multiple percent pairs
😀 (emoji)%F0%9F%98%804-byte UTF-8 character → 4 percent-encoded pairs
https://example.com/search?q=hello world&lang=plhttps%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3DplFull URL with query string — encode the entire value, not just the parameter

Use Cases

Related Tools

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding) is the process of converting characters that are not permitted in a URL into a safe ASCII format. Each unsafe character is replaced by a % sign followed by two hex digits. It is defined in RFC 3986 and used by browsers, servers, and APIs to ensure URLs are transmitted and interpreted correctly.

What is the difference between %20 and + for spaces?

%20 is the universal percent-encoded form of a space and is valid in every part of a URL. The + character represents a space only in the application/x-www-form-urlencoded format used by HTML forms — strictly inside query strings. If you are constructing URLs manually or passing values to APIs, always use %20 to avoid ambiguity.

How do I decode a URL online?

Switch the tool to Decode mode and paste the percent-encoded URL or string into the input box. The decoded, human-readable text appears immediately. The entire operation runs in your browser — no data is transmitted to any server, so it is safe to decode URLs containing sensitive tokens or credentials.

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes everything except unreserved characters (A–Z a–z 0–9 - _ . ! ~ * ' ( )) and is the right choice for encoding individual parameter values. encodeURI leaves structural URL characters like / : ? # @ intact because it is designed to encode a full URL without breaking its structure. Our tool uses encodeURIComponent, which is the safer default for encoding values rather than entire URLs.

How do I encode Polish or other non-ASCII characters in a URL?

Non-ASCII characters (Polish: ą ę ó ź ż ć ń; Cyrillic, CJK, emoji, etc.) are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, ą (U+0105) becomes the two UTF-8 bytes 0xC4 0x85, encoded as %C4%85. Paste any text containing non-ASCII characters into the encoder and the tool handles the entire conversion automatically.

What is the difference between URL encoding and HTML encoding?

URL encoding (percent-encoding) is used to safely include characters inside a URL — it converts them to %XX sequences. HTML encoding (HTML entity encoding) is used to safely include characters inside HTML markup — it converts characters like < to &lt; so they are displayed as text rather than parsed as HTML tags. The two systems are completely separate. Use our HTML Encode / Decode tool for HTML encoding needs.

Is this URL encoder safe to use? Is my data stored?

Yes, completely safe. CleanTextFree processes all input locally in your browser using JavaScript. No text is ever sent to our servers. This applies whether you are encoding query parameters, API keys, OAuth tokens, or personal data. The tool works fully offline once the page has loaded.

From the Blog

See all guides →