URL 파서
URL을 호스트·경로·쿼리로 분해 분석
전체 URL(http:// 또는 https:// 포함)을 입력하고 분석을 누르세요.Enter a full URL (including http:// or https://) and press Parse.
URL 파서란?
URL 파서는 URL 한 줄을 프로토콜(scheme)·호스트명·포트·경로(path)·해시(fragment)와 쿼리 파라미터로 분해해 보여주는 도구입니다. API 요청 URL을 분석하거나, 쿼리 파라미터 구조를 확인할 때 유용합니다. 브라우저 내장 URL 객체를 사용합니다.
각 항목 설명
- 프로토콜:
https:처럼 콜론을 포함한 스킴입니다. - 호스트명: 도메인 또는 IP 주소이며 포트는 제외됩니다.
- 포트: URL에 명시된 포트 번호입니다. 생략되면 비어 있습니다.
- 쿼리 파라미터:
?뒤의key=value쌍을 각각 행으로 표시합니다. 같은 키가 여러 번 나오면 각각 별도 행입니다.
개인정보·처리 방식
모든 분석은 브라우저 내장 URL 객체만으로 이루어집니다. 입력한 URL은 서버로 전송되거나 저장되지 않습니다.
URL 구조 표준: 5가지 구성요소
RFC 3986 표준에 따르면 URL(정확히는 URI)은 스킴(scheme)·권한부(authority)·경로(path)·쿼리(query)·프래그먼트(fragment) 다섯 구성요소로 이루어집니다. 권한부는 다시 사용자정보(userinfo)·호스트(host)·포트(port)로 나뉩니다. 예를 들어 https://user@a.com:8080/p/q?x=1#h를 구성요소별로 나누면 아래와 같습니다.
| 구성요소 | 값 | 설명 |
|---|---|---|
| 스킴 | https: | 프로토콜(전송 방식)을 지정하는 접두부 |
| 권한부 | user@a.com:8080 | 사용자정보·호스트·포트의 조합 |
| 경로 | /p/q | 서버 내 리소스의 위치 |
| 쿼리 | ?x=1 | 서버에 전달할 key=value 파라미터 |
| 프래그먼트 | #h | 클라이언트에서만 쓰이는 문서 내 위치(서버로 전송되지 않음) |
이 도구는 이 다섯 구성요소를 브라우저 내장 URL 객체로 정확히 나눠 보여줍니다. 프래그먼트는 서버로 전달되지 않고 브라우저에만 남는다는 점이 다른 네 요소와의 중요한 차이입니다.
퍼센트 인코딩이 필요한 이유와 + vs %20 함정
URI 표준은 영문자·숫자와 일부 기호(-._~ 등)만 안전 문자로 정의하고, 공백·한글·&·?·#처럼 URL 문법에서 특별한 의미를 갖거나 아예 허용되지 않는 문자는 퍼센트 인코딩(% + 2자리 16진수)으로 바꿔야 합니다. 이렇게 하지 않으면 &가 파라미터 구분자로 오해되거나, 공백이 URL을 중간에서 끊어버리는 등 파싱 오류가 생깁니다.
encodeURIComponent(' ')는 %20을 만들지만, application/x-www-form-urlencoded 방식(폼 전송·쿼리스트링)에서는 +가 공백으로 해석됩니다. 반대로 문자 그대로의 +(예: 이메일의 user+tag@a.com)를 쿼리에 넣으려면 반드시 %2B로 인코딩해야 공백으로 오인되지 않습니다. 실제로 new URLSearchParams('q=a+b').get('q')는 'a b'를 반환해 +가 공백으로 해석됨을 확인할 수 있습니다.
What is this tool?
The URL parser breaks a URL into its protocol, hostname, port, pathname, hash and query parameters. Useful for inspecting API request URLs or checking query string structure. It uses the browser's built-in URL object.
What each field means
- Protocol: the scheme including the colon, e.g.
https:. - Hostname: the domain or IP address, without the port.
- Port: the port explicitly specified in the URL; empty if omitted.
- Query parameters: each
key=valuepair after?shown as a row; repeated keys appear as separate rows.
Privacy & processing
All parsing uses only the browser's built-in URL object. Your URL is never uploaded or stored.
URL structure — the 5 standard components
Per RFC 3986, a URL (URI) is made of five parts: scheme, authority, path, query, and fragment. The authority further splits into userinfo, host, and port. Breaking down https://user@a.com:8080/p/q?x=1#h gives:
| Component | Value | Meaning |
|---|---|---|
| Scheme | https: | The protocol prefix |
| Authority | user@a.com:8080 | Userinfo + host + port |
| Path | /p/q | Resource location on the server |
| Query | ?x=1 | key=value parameters sent to the server |
| Fragment | #h | Client-only location, never sent to the server |
This tool splits these five parts precisely using the browser's built-in URL object. The fragment's key difference: it never leaves the browser.
Why percent-encoding exists, and the + vs %20 trap
The URI spec treats only letters, digits, and a few symbols (-._~) as safe; spaces, non-ASCII text, and characters with special meaning like &, ?, # must be percent-encoded (% plus two hex digits). Skip this and an & can be misread as a parameter separator, or a space can truncate the URL mid-parse.
encodeURIComponent(' ') produces %20, but form-encoded query strings (application/x-www-form-urlencoded) treat + as a space instead. A literal + (like the one in user+tag@a.com) must be encoded as %2B or it gets decoded as a space — confirmed by new URLSearchParams('q=a+b').get('q') returning 'a b'.