URL Encoder / Decoder
Safely encode URLs containing non-ASCII characters.
๐ How to Use
Type or paste the URL or text you want to encode.
e.g.
https://example.com/search?q=hello
Click ๐ผ Encode to percent-encode special characters, or ๐ฝ Decode to revert them.
Check the result and click ๐ Copy to save to your clipboard.
About the URL Encoder / Decoder
A URL (URI, defined by RFC 3986) may only carry a limited set of ASCII characters. Anything outside that set — a space, a brace, Hangul, an emoji, or any byte with the high bit set — must be percent-encoded before it can appear in a URL. This tool performs that encoding and its reverse, so you can safely embed arbitrary text in a path or query string and recover the original later. Everything runs in your browser; nothing is sent anywhere.
How it works
Percent-encoding writes a byte as a percent sign followed by two hexadecimal digits: %XX. RFC 3986 splits characters into two groups. Unreserved characters — A–Z, a–z, 0–9, and - . _ ~ — never need encoding because they have no special meaning. Reserved characters — the gen-delims : / ? # [ ] @ and the sub-delims ! $ & ' ( ) * + , ; = — act as delimiters, so whether they must be encoded depends on where they appear.
JavaScript exposes two functions for this. encodeURI leaves the reserved characters untouched, because it assumes you are encoding an entire URL where :// and ?q= must stay literal. encodeURIComponent encodes those reserved characters too, because it targets a single component — a query value or a path segment — where a literal ? or & would be misread as a delimiter. For non-ASCII text such as Hangul, the text is first converted to its UTF-8 byte sequence and each byte is then percent-encoded; a single Korean character usually becomes three %XX groups.
Common use cases
- Building a query string whose value contains spaces or non-ASCII text
- Passing a redirect URL inside another URL as a parameter
- Embedding JSON, Base64, or free-form search terms safely in a path
- Handling Hangul, CJK, or emoji in shareable links
- Debugging a broken link by inspecting or reverting percent-encoding
Worked example
Encoding a search URL whose query contains spaces and Korean text:
Input:
https://example.com/search?q=hello world ํ๊ตญ์ด
encodeURIComponent("hello world ํ๊ตญ์ด")
=> "hello%20world%20%ED%95%9C%EA%B5%AD%EC%96%B4"
Full encoded URL:
https://example.com/search?q=hello%20world%20%ED%95%9C%EA%B5%AD%EC%96%B4
The space becomes %20, and each Hangul syllable expands to three UTF-8 bytes (%ED%95%9C for ํ, and so on). The reserved ? and = in the full URL are left intact, exactly as encodeURI would.
Frequently asked questions
What is percent-encoding?
Percent-encoding is the mechanism defined in RFC 3986 for representing characters inside a URI. Any byte that is not an unreserved character is written as a percent sign followed by the two hexadecimal digits of that byte, for example a space becomes %20.
What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves reserved characters such as : / ? # [ ] @ intact, so it is meant for a whole URL. encodeURIComponent encodes those reserved characters too, so it is meant for a single query parameter value or path segment where they must not be treated as delimiters.
Why do spaces sometimes become %20 and sometimes +?
Both represent a space. %20 is the percent-encoded form used by RFC 3986 in the path and query. The plus sign is the older application/x-www-form-urlencoded form inherited from HTML forms. This tool uses the standard percent-encoded form (%20).
How are Korean or emoji characters encoded?
Non-ASCII characters are first converted to their UTF-8 byte sequence, then each byte is percent-encoded. Hangul is usually three bytes, so one Korean character turns into three %XX groups. Decoding reverses the process to recover the original text.
Is my input sent to a server?
No. Encoding and decoding run entirely in your browser using the native encodeURI and decodeURIComponent functions. Your input never leaves your device.
URL ์ธ์ฝ๋/๋์ฝ๋๋?
URL(URI, RFC 3986์ ์ ์๋จ)์ ์ ํ๋ ASCII ๋ฌธ์๋ง ๋ด์ ์ ์์ต๋๋ค. ๊ทธ ์งํฉ ๋ฐ์ ๋ชจ๋ ๊ฒ — ๊ณต๋ฐฑ, ์ค๊ดํธ, ํ๊ธ, ์ด๋ชจ์ง, ์ต์์ ๋นํธ๊ฐ 1์ธ ๋ฐ์ดํธ — ์ URL์ ๋ค์ด๊ฐ๊ธฐ ์ ์ ํผ์ผํธ ์ธ์ฝ๋ฉ๋์ด์ผ ํฉ๋๋ค. ์ด ๋๊ตฌ๋ ๊ทธ ์ธ์ฝ๋ฉ๊ณผ ์ญ์ฐ์ฐ์ ์ํํ์ฌ ๊ฒฝ๋ก๋ ์ฟผ๋ฆฌ ๋ฌธ์์ด์ ์์ ํ ์คํธ๋ฅผ ์์ ํ๊ฒ ๋ฃ๊ณ ๋์ค์ ์๋ณธ์ ๋์ฐพ์ ์ ์๊ฒ ํฉ๋๋ค. ๋ชจ๋ ์ฒ๋ฆฌ๋ ๋ธ๋ผ์ฐ์ ์์ ์ด๋ฃจ์ด์ง๋ฉฐ ์ธ๋ถ๋ก ์ ์ก๋์ง ์์ต๋๋ค.
์๋ ๋ฐฉ์
ํผ์ผํธ ์ธ์ฝ๋ฉ์ ๋ฐ์ดํธ๋ฅผ ํผ์ผํธ ๊ธฐํธ์ ๋ ์๋ฆฌ 16์ง์๋ก ํ๊ธฐํฉ๋๋ค: %XX. RFC 3986์ ๋ฌธ์๋ฅผ ๋ ๊ทธ๋ฃน์ผ๋ก ๋๋๋๋ค. ๋น์์ฝ(unreserved) ๋ฌธ์ — A–Z, a–z, 0–9, ๊ทธ๋ฆฌ๊ณ - . _ ~ — ์ ํน๋ณํ ์๋ฏธ๊ฐ ์์ด ์ธ์ฝ๋ฉํ ํ์๊ฐ ์์ต๋๋ค. ์์ฝ(reserved) ๋ฌธ์ — ์ผ๋ฐ ๊ตฌ๋ถ์ : / ? # [ ] @์ ํ์ ๊ตฌ๋ถ์ ! $ & ' ( ) * + , ; = — ๋ ๊ตฌ๋ถ์ ์ญํ ์ ํ๋ฏ๋ก, ์ธ์ฝ๋ฉํด์ผ ํ๋์ง๋ ๋ฑ์ฅ ์์น์ ๋ฐ๋ผ ๋ค๋ฆ
๋๋ค.
์๋ฐ์คํฌ๋ฆฝํธ๋ ์ด๋ฅผ ์ํ ํจ์ ๋ ๊ฐ๋ฅผ ์ ๊ณตํฉ๋๋ค. encodeURI๋ ์์ฝ ๋ฌธ์๋ฅผ ๊ทธ๋๋ก ๋ก๋๋ค. ์ ์ฒด URL์ ์ธ์ฝ๋ฉํ๋ค๊ณ ๊ฐ์ ํ์ฌ ://์ ?q=๊ฐ ๋ฆฌํฐ๋ด๋ก ๋จ์์ผ ํ๊ธฐ ๋๋ฌธ์
๋๋ค. ๋ฐ๋ฉด encodeURIComponent๋ ์์ฝ ๋ฌธ์๊น์ง ์ธ์ฝ๋ฉํฉ๋๋ค. ์ฟผ๋ฆฌ ๊ฐ์ด๋ ๊ฒฝ๋ก ์ธ๊ทธ๋จผํธ ๊ฐ์ ๋จ์ผ ์ปดํฌ๋ํธ๋ฅผ ๋์์ผ๋ก ํ์ฌ, ๋ฆฌํฐ๋ด ?๋ &๊ฐ ๊ตฌ๋ถ์๋ก ์๋ชป ์ฝํ๋ ๊ฒ์ ๋ง์ต๋๋ค. ํ๊ธ ๊ฐ์ ๋น-ASCII ํ
์คํธ๋ ๋จผ์ UTF-8 ๋ฐ์ดํธ ์ํ์ค๋ก ๋ณํ๋ ๋ค ๊ฐ ๋ฐ์ดํธ๊ฐ ํผ์ผํธ ์ธ์ฝ๋ฉ๋๋ฉฐ, ํ ๊ธ์๋ ๋ณดํต ์ธ ๊ฐ์ %XX ๊ทธ๋ฃน์ด ๋ฉ๋๋ค.
์์ฃผ ์ฐ๋ ๊ฒฝ์ฐ
- ๊ฐ์ ๊ณต๋ฐฑ์ด๋ ๋น-ASCII ํ ์คํธ๊ฐ ์๋ ์ฟผ๋ฆฌ ๋ฌธ์์ด ๋ง๋ค๊ธฐ
- ๋ฆฌ๋ค์ด๋ ํธ URL์ ๋ค๋ฅธ URL์ ํ๋ผ๋ฏธํฐ๋ก ์ ๋ฌํ๊ธฐ
- JSON, Base64, ์์ ํ์ ๊ฒ์์ด๋ฅผ ๊ฒฝ๋ก์ ์์ ํ๊ฒ ๋ฃ๊ธฐ
- ๊ณต์ ๊ฐ๋ฅํ ๋งํฌ์์ ํ๊ธ, CJK, ์ด๋ชจ์ง ์ฒ๋ฆฌํ๊ธฐ
- ํผ์ผํธ ์ธ์ฝ๋ฉ์ ๊ฒ์ฌํ๊ฑฐ๋ ๋๋๋ ค ๊นจ์ง ๋งํฌ ๋๋ฒ๊น ํ๊ธฐ
์ฌ์ฉ ์
์ฟผ๋ฆฌ์ ๊ณต๋ฐฑ๊ณผ ํ๊ตญ์ด๊ฐ ํฌํจ๋ ๊ฒ์ URL์ ์ธ์ฝ๋ฉํ๋ฉด:
Input:
https://example.com/search?q=hello world ํ๊ตญ์ด
encodeURIComponent("hello world ํ๊ตญ์ด")
=> "hello%20world%20%ED%95%9C%EA%B5%AD%EC%96%B4"
Full encoded URL:
https://example.com/search?q=hello%20world%20%ED%95%9C%EA%B5%AD%EC%96%B4
๊ณต๋ฐฑ์ %20์ด ๋๊ณ , ํ๊ธ ์์ ๊ฐ๊ฐ์ UTF-8 3๋ฐ์ดํธ๋ก ํ์ฅ๋ฉ๋๋ค(ํ → %ED%95%9C). ์ ์ฒด URL ์์ ์์ฝ ๋ฌธ์ ?์ =๋ encodeURI๊ฐ ํ๋ฏ ๊ทธ๋๋ก ๋จ์ต๋๋ค.
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
ํผ์ผํธ ์ธ์ฝ๋ฉ์ด๋ ๋ฌด์์ธ๊ฐ์?
ํผ์ผํธ ์ธ์ฝ๋ฉ์ URI ์์ ๋ฌธ์๋ฅผ ํํํ๊ธฐ ์ํด RFC 3986์ ์ ์๋ ๋ฉ์ปค๋์ฆ์
๋๋ค. ๋น์์ฝ ๋ฌธ์๊ฐ ์๋ ๋ชจ๋ ๋ฐ์ดํธ๋ ํผ์ผํธ ๊ธฐํธ ๋ค์ ํด๋น ๋ฐ์ดํธ์ ๋ ์๋ฆฌ 16์ง์๋ฅผ ๋ถ์ฌ ํ๊ธฐํฉ๋๋ค. ์๋ฅผ ๋ค์ด ๊ณต๋ฐฑ์ %20์ด ๋ฉ๋๋ค.
encodeURI์ encodeURIComponent์ ์ฐจ์ด๋?
encodeURI๋ : / ? # [ ] @ ๊ฐ์ ์์ฝ ๋ฌธ์๋ฅผ ๊ทธ๋๋ก ๋์ด ์ ์ฒด URL ์ฉ๋๋ก ์ฐ์
๋๋ค. encodeURIComponent๋ ์์ฝ ๋ฌธ์๊น์ง ์ธ์ฝ๋ฉํ์ฌ ๋จ์ผ ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ ๊ฐ์ด๋ ๊ฒฝ๋ก ์ธ๊ทธ๋จผํธ์ฒ๋ผ ์์ฝ ๋ฌธ์๊ฐ ๊ตฌ๋ถ์๋ก ์ทจ๊ธ๋๋ฉด ์ ๋๋ ๊ณณ์ ์๋๋ค.
๊ณต๋ฐฑ์ด ์ด๋จ ๋ %20, ์ด๋จ ๋ +๊ฐ ๋๋ ์ด์ ๋?
๋ ๋ค ๊ณต๋ฐฑ์ ๋ปํฉ๋๋ค. %20์ RFC 3986์์ ๊ฒฝ๋ก์ ์ฟผ๋ฆฌ์ ์ฐ๋ ํผ์ผํธ ์ธ์ฝ๋ฉ ํํ์
๋๋ค. ๋ํ๊ธฐ ๊ธฐํธ๋ HTML ํผ์์ ์ ๋ํ ์ค๋๋ application/x-www-form-urlencoded ํํ์
๋๋ค. ์ด ๋๊ตฌ๋ ํ์ค ํผ์ผํธ ์ธ์ฝ๋ฉ ํํ(%20)๋ฅผ ์ฌ์ฉํฉ๋๋ค.
ํ๊ตญ์ด๋ ์ด๋ชจ์ง๋ ์ด๋ป๊ฒ ์ธ์ฝ๋ฉ๋๋์?
๋น-ASCII ๋ฌธ์๋ ๋จผ์ UTF-8 ๋ฐ์ดํธ ์ํ์ค๋ก ๋ณํ๋ ๋ค ๊ฐ ๋ฐ์ดํธ๊ฐ ํผ์ผํธ ์ธ์ฝ๋ฉ๋ฉ๋๋ค. ํ๊ธ์ ๋ณดํต 3๋ฐ์ดํธ์ด๋ฏ๋ก ํ ๊ธ์๊ฐ ์ธ ๊ฐ์ %XX ๊ทธ๋ฃน์ด ๋ฉ๋๋ค. ๋์ฝ๋ฉํ๋ฉด ๊ณผ์ ์ด ์ญ์์ผ๋ก ์งํ๋์ด ์๋ณธ ํ
์คํธ๊ฐ ๋ณต์๋ฉ๋๋ค.
์ ๋ ฅ์ด ์๋ฒ๋ก ์ ์ก๋๋์?
์๋๋๋ค. ์ธ์ฝ๋ฉ๊ณผ ๋์ฝ๋ฉ์ ์ ์ ์ผ๋ก ๋ธ๋ผ์ฐ์ ์์ ๋ค์ดํฐ๋ธ encodeURI/decodeURIComponent ํจ์๋ก ์ฒ๋ฆฌ๋ฉ๋๋ค. ์
๋ ฅ์ ๊ธฐ๊ธฐ๋ฅผ ๋ ๋์ง ์์ต๋๋ค.