URL Encoder & Decoder
Encode or decode URL components safely
URL Encoder & Decoder — what it does
Percent-encode text so it can travel safely inside a URL, or decode an encoded string back into readable characters. Spaces, ampersands, question marks and non-ASCII characters all have structural meaning in a URL, and encoding is what keeps a value from being read as syntax.
Worked example
A file name with spaces, parentheses, an ampersand, a slash, an em dash and Chinese characters, encoded with the Encode button for use as a single query-string value.
Input — text
Q4 report (final) & budget 2026/27 — 報告.pdf
Output — percent-encoded
Q4%20report%20(final)%20%26%20budget%202026%2F27%20%E2%80%94%20%E5%A0%B1%E5%91%8A.pdf
Parentheses, the dot and the digits are left unencoded; the slash becomes %2F and each Chinese character becomes three bytes, e.g. %E5%A0%B1.
When this tool helps
- Building a query parameter that contains spaces, symbols or non-ASCII text.
- Decoding a URL from a log or an address bar to see what was actually requested.
- Fixing a link that breaks because a parameter value contained an unencoded character.
How to use it
- Paste the text or the encoded string.
- Choose encode or decode.
- Read the output.
- Copy the result into your URL or request.
Accuracy, limits, and good practice
- Encode parameter values, not the whole URL — encoding the separators too turns a working address into one long unusable string.
- A space becomes %20 in a path and may appear as a plus sign in a query string; both decode back to a space in that context.
- Double-encoding is the classic bug: %2520 is an encoded percent sign followed by 20, and it means the value went through encoding twice.
Frequently asked questions
Which characters need encoding?
Anything with structural meaning — space, ampersand, question mark, hash, plus, slash inside a value — along with all non-ASCII characters.
Why does my link break with a plus in it?
A plus can be interpreted as a space in a query string. Encode it as %2B when it is meant literally.
Is encoding the same as escaping HTML?
No. URL encoding protects a value inside an address; HTML entity encoding protects it inside markup. Different contexts, different rules.
Can I encode a complete URL in one go?
Not usefully: Encode treats the whole box as a single value, so https://, the slashes, ? and & all get encoded (the slash in 2026/27 above became %2F). Paste only the value of one parameter, encode it, then place it after the = yourself. Spaces always become %20, never +.
What does "URI malformed" mean?
Decode found a % sign that is not followed by two hex digits, or a byte sequence that is not valid UTF-8, and stopped; the message is shown in the output box instead of a result. "100%25 done 50% off" fails on the lone % before " off". Write a literal percent sign as %25 before decoding. Decode leaves + signs as + — it does not turn them into spaces.
Related tools on this site
- HTML Minifier — Remove comments and unnecessary whitespace from HTML
- Lorem Ipsum Generator — Generate placeholder paragraphs for layouts and documents
- Text Difference Checker — Compare two texts line by line and highlight changes
Further reading: Cleaning Up Text You Pasted From Somewhere Else
Everything above runs inside this page. URL Encoder & Decoder needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
網址編碼與解碼能做什麼
把文字做百分號編碼,讓它能安全地放進網址;或把編碼字串解碼回可讀字元。空格、與號、問號與非 ASCII 字元在網址中都有結構性意義,編碼正是避免「值」被當成「語法」解讀的方法。
實際範例
一個含空格、括號、& 符號、斜線、長破折號與中文字的檔名,按「編碼」轉成可作為單一參數值的形式。
來源:文字
Q4 report (final) & budget 2026/27 — 報告.pdf
百分比編碼後
Q4%20report%20(final)%20%26%20budget%202026%2F27%20%E2%80%94%20%E5%A0%B1%E5%91%8A.pdf
括號、句點與數字不會被編碼;斜線變成 %2F,每個中文字變成三個位元組,例如 %E5%A0%B1。
什麼時候用得上
- 組出含空格、符號或非 ASCII 文字的查詢參數。
- 解碼日誌或網址列上的網址,看清實際請求了什麼。
- 修復因參數值含未編碼字元而失效的連結。
使用步驟
- 貼上文字或編碼字串。
- 選擇編碼或解碼。
- 查看輸出。
- 把結果複製進網址或請求中。
精確度、限制與實務建議
- 請只編碼參數值,不要編碼整個網址——連分隔符一起編碼,會把可用的網址變成一長串廢字串。
- 空格在路徑中變成 %20,在查詢字串中可能顯示為加號,在該情境下兩者都會解回空格。
- 重複編碼是經典錯誤:%2520 是編碼過的百分號再加 20,代表這個值被編碼了兩次。
常見問題
哪些字元需要編碼?
所有具結構意義的字元——空格、與號、問號、井號、加號、值內的斜線——以及所有非 ASCII 字元。
連結裡有加號為什麼會壞掉?
加號在查詢字串中可能被解讀成空格。若它就是字面上的加號,請編碼成 %2B。
網址編碼跟 HTML 逸出一樣嗎?
不一樣。網址編碼保護的是位址中的值,HTML 實體編碼保護的是標記中的值,情境不同、規則也不同。
可以把整個網址一次編碼嗎?
不建議:「編碼」把整個方框的內容當成單一值,所以 https://、斜線、? 與 & 全都會被編碼(上面 2026/27 的斜線就變成了 %2F)。請只貼上某一個參數的值,編碼後再自行放到 = 後面。空格一律變成 %20,不會變成 +。
「URI malformed」是什麼意思?
解碼時遇到了後面不是兩位十六進位數字的 % 符號,或是不合法的 UTF-8 位元組序列,於是中止,並把這則訊息顯示在原本放文字的位置。「100%25 done 50% off」會在「 off」前那個單獨的 % 失敗。解碼前請把字面上的百分號寫成 %25。解碼不會把 + 變成空格,+ 會原樣保留。
本站相關工具
- HTML 壓縮工具 — 移除 HTML 註解與多餘空白
- Lorem Ipsum 產生器 — 為版面與文件產生佔位段落
- 文字差異比較 — 逐行比較兩段文字並標示變更
延伸閱讀: 清理從別處貼上的文字
以上步驟全部在這個頁面內完成,網址編碼與解碼 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。