인코딩
URL Encode/Decode
URL 인코딩 및 디코딩 — 링크와 쿼리 파라미터에서 이스케이프해야 하는 문자.
URL encoding (percent-encoding) replaces characters that aren't allowed in a URL — spaces, non-Latin letters, special characters — with %XX sequences, where XX is the hex code of the byte. This keeps links and query parameters from getting mangled in transit.
How to use it
- Encode: paste text or a URL and any character outside the safe ASCII set is replaced with a %XX sequence.
- Decode: paste an encoded string to see the original text.
- Encoding a full URL and encoding a single query parameter use slightly different safe-character sets — pick the mode that matches what you're encoding.
Common uses
- Building query parameters from text containing spaces, ampersands, or non-Latin characters.
- Debugging why a link with a parameter breaks — often the cause is an unencoded special character.
- Decoding URLs from third-party systems to read them in their original form.
Things to keep in mind
Encode parameter values, not the whole URL at once — otherwise you'll also encode the separators you need (:, /, ?, &).
JavaScript's encodeURIComponent and encodeURI encode different character sets — the former is meant specifically for parameter values.
자주 묻는 질문
URL 인코딩(퍼센트 인코딩)은 언제 필요한가요?
URL의 쿼리 파라미터나 경로에 공백, 한글, &, = 같은 특수 문자를 넣을 때 %XX 형식으로 이스케이프해야 합니다. 그렇지 않으면 링크가 깨지거나 파라미터가 잘못 해석될 수 있습니다.
URL 인코딩과 URL-safe Base64는 같은 건가요?
아니요, 서로 다른 인코딩입니다. URL 인코딩은 특수 문자를 %XX로 이스케이프하는 방식이고, URL-safe Base64는 +와 /를 -와 _로 바꾼 Base64 변형입니다. 이 도구는 퍼센트 인코딩만 다룹니다.
컴포넌트와 URI 모드는 어떤 차이가 있나요?
컴포넌트 모드는 쿼리 파라미터 값처럼 URL의 한 조각을 인코딩할 때 쓰며 &, =, / 같은 문자까지 이스케이프합니다. URI 모드는 URL 전체를 대상으로 하며 :, /, ? 등 URL 구조에 필요한 문자는 그대로 둡니다.
이중 인코딩이란 무엇이고 어떻게 알아볼 수 있나요?
이미 인코딩된 문자열을 한 번 더 인코딩하는 실수로, % 기호 자체가 %25로 변환되어 %20이 %2520이 됩니다. 디코딩 결과에 %25XX 형태의 시퀀스가 보인다면 이 문제의 징후입니다.
공백이 어떤 때는 +로, 어떤 때는 %20으로 인코딩되나요?
공백을 +로 표현하는 것은 폼과 쿼리 문자열에서 쓰이는 application/x-www-form-urlencoded 형식입니다. %20은 RFC 3986의 표준 percent-encoding으로, URL의 어느 부분에서든 올바르게 사용할 수 있습니다.