URL Encoder & Decoder URL 编码 / 解码工具

Paste a URL or any text, then encode it into percent-encoded form — or decode it back. Full Unicode support: Chinese characters, emoji and every other script encode correctly as UTF-8. Everything happens on this page, in your browser; nothing you type is sent anywhere. 在浏览器本地完成,支持中文与 emoji。

Encode mode 编码模式

Input: 0 characters UTF-8 bytes: 0 Output: 0 characters

How to use it 使用方法

  1. Paste your text 粘贴文本

    Put a full URL, a single query value, or any plain text into the input box. Long text is fine.

  2. Pick a mode 选择模式

    Encoding a whole address? Choose Encode full URL. Encoding one value that will sit inside a URL? Choose Encode component.

  3. Encode or decode 点击按钮

    Press Encode to percent-encode, or Decode to turn %XX sequences back into readable text. Decoding accepts both modes.

  4. Copy the result 复制结果

    Copy the result to your clipboard, download it as a .txt file, or press Swap to run it back through the other way.

Quick reference 常用对照

The characters that come up most often, and what they become. Every non-ASCII character is encoded byte by byte from its UTF-8 form — that's why one Chinese character turns into three %XX groups.

Character 字符Encoded 编码后Note 说明
Space 空格%20The standard encoding for a space in a URL. (+ means space only in form data.)
中 (one Chinese character)%E4%B8%ADThree UTF-8 bytes: E4 B8 AD, each written as % + two hex digits.
😀 (emoji)%F0%9F%98%80Four UTF-8 bytes.
& = ? #%26 %3D %3F %23Encoded in component mode, kept as URL structure in full-URL mode.
% itself%25A literal percent sign must be encoded, or a decoder will read it as the start of a code.

Frequently asked questions 常见问题

What is URL encoding? 什么是 URL 编码?

A URL can only safely contain a limited set of characters — letters, digits and a handful of symbols. URL encoding (also called percent-encoding) rewrites every other character as a % followed by two hexadecimal digits, one group per byte of the character's UTF-8 form. A space becomes %20, and the character 中 becomes %E4%B8%AD. Browsers and servers decode these sequences automatically, so the text arrives exactly as written — it just travels in a form a URL can carry.

When do I use “Encode full URL” vs “Encode component”? 两种模式怎么选?

Use Encode full URL when you have a complete address that must keep working: the characters that give a URL its structure — : / ? # & = and friends — stay untouched, and only things like spaces and non-ASCII text are encoded. Use Encode component when the text is one value that will be placed inside a URL — a search query, a user name, a redirect destination. There, characters like & and = inside the value must be encoded too, or they'd be mistaken for the URL's own separators and corrupt it.

What does %20 mean? %20 是什么?

%20 is a space. 20 is the hexadecimal code for the space character, and the % in front marks it as an encoded byte. You'll also see spaces written as + in query strings produced by HTML forms — that plus-sign convention belongs to form encoding (application/x-www-form-urlencoded), not to URLs in general, which is why this tool only treats + as a space when you tick the option.

Is URL encoding a form of encryption? 这是加密吗?

No. URL encoding is a transport format, not encryption. Anyone can decode a percent-encoded string instantly — this page just did — and it hides nothing. It exists so characters that aren't allowed in a URL can travel inside one, nothing more. For actually protecting data, you need HTTPS in transit and real encryption for stored secrets; encoding plays no part in either.

Why did decoding stop with an error? 解码报错怎么办?

Every % in encoded text must be followed by exactly two hexadecimal digits (0–9, A–F). A stray %, a sequence like %2G, or a string cut off mid-sequence can't be decoded, so the tool stops and tells you which character is wrong and where it sits, instead of guessing. Fix that spot — often the text was copied incompletely — and decode again.