ToolHub
Open Tool

URL Encode / Decode

Encode and decode URL components

Format Converter

About This Tool

URL Encode / Decode is a browser-based tool that converts text into URL-encoded format (percent-encoding) and decodes encoded URLs back to readable text. It uses the standard encodeURIComponent and decodeURIComponent functions, handling special characters like spaces, ampersands, and query parameters correctly. All processing happens locally in your browser — no data is ever sent to a server.

Key Features

How to Use

  1. Paste or type your text or URL into the input area.
  2. Click encode to convert special characters to URL-safe format, or decode to revert.
  3. View the encoded/decoded result instantly in the output area.
  4. Copy the result to your clipboard with one click.

Quick Preview

Use Cases

url encoding percent-encoding query

Frequently Asked Questions

What is URL encoding (percent-encoding)?

URL encoding, also known as percent-encoding, replaces unsafe or reserved characters in a URL with a % followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures that special characters do not break the URL structure.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but preserves characters like :, /, ?, &, and = that have structural meaning in URLs. encodeURIComponent encodes everything, including those reserved characters, making it suitable for encoding individual query parameter values where those characters should also be escaped.

Does this tool support encoding Chinese characters?

Yes. The tool uses the browser's native encodeURIComponent function, which fully supports UTF-8 encoding. Chinese characters, Japanese, Korean, emoji, and any other Unicode characters are correctly encoded into percent-encoded sequences.

Why does my decoded text look wrong or show an error?

This usually happens when the input is not a valid percent-encoded string. Make sure the encoded string uses the correct format — each percent sign should be followed by exactly two hexadecimal digits (0-9, A-F). Incomplete or malformed sequences will cause decoding errors.

Is URL encoding the same as HTML entity encoding?

No, they are different. URL encoding uses percent signs followed by hex digits (e.g., %20 for space), while HTML entity encoding uses ampersand-based sequences (e.g.,   for space). They serve different purposes — URL encoding is for URLs, while HTML entities are for HTML content.