개발자

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=value pair 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:

ComponentValueMeaning
Schemehttps:The protocol prefix
Authorityuser@a.com:8080Userinfo + host + port
Path/p/qResource location on the server
Query?x=1key=value parameters sent to the server
Fragment#hClient-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.

Real-world trap: 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'.
URL 파서는 무엇을 해주나요?
URL 하나를 입력하면 프로토콜(scheme), 호스트명, 포트, 경로(path), 해시(fragment), 쿼리 파라미터를 각각 분리해 표로 보여줍니다. 브라우저 내장 URL 객체를 사용해 정확하게 파싱합니다.
쿼리 파라미터가 여러 개거나 중복되면 어떻게 되나요?
같은 이름의 파라미터가 여러 번 나오면 각각 별도의 행으로 표시됩니다. 예를 들어 ?tag=a&tag=b는 tag=a, tag=b 두 행으로 나옵니다. 값이 없는 파라미터(?flag)는 빈 값으로 표시됩니다.
포트나 쿼리가 없는 URL도 처리되나요?
네. 포트가 생략된 URL은 포트 칸에 프로토콜 기본값 표시 없이 비워 두거나 안내 문구를 표시하고, 쿼리 파라미터가 없으면 '쿼리 파라미터 없음'이라고 안내합니다.
잘못된 형식의 URL을 입력하면 어떻게 되나요?
프로토콜이 없거나 형식이 올바르지 않아 브라우저의 URL 생성자가 파싱에 실패하면 '유효한 URL이 아닙니다'라는 오류 안내가 표시됩니다. http:// 또는 https:// 를 포함한 전체 URL을 입력해야 합니다.
입력한 URL이 서버로 전송되나요?
아니요. 파싱은 브라우저 내장 URL 객체만으로 이루어지며, 입력한 URL은 서버로 전송되거나 저장되지 않습니다.
URL은 어떤 구성요소로 이루어지나요?
URL(URI)은 RFC 3986 표준에 따라 스킴(scheme)·권한부(authority: 사용자정보·호스트·포트)·경로(path)·쿼리(query)·프래그먼트(fragment) 다섯 구성요소로 이루어집니다. 이 중 프래그먼트만 서버로 전송되지 않고 브라우저 안에만 남습니다.
퍼센트 인코딩(%20 등)은 왜 필요한가요?
URI 표준에서 영문자·숫자·일부 기호 외의 문자(공백·한글·&·?·# 등)는 URL 문법에서 특별한 의미를 갖거나 허용되지 않으므로 %+16진수 2자리로 인코딩해야 합니다. 인코딩하지 않으면 &가 파라미터 구분자로 오인되거나 URL이 중간에서 끊기는 등 파싱 오류가 발생합니다.
쿼리스트링에서 공백을 +로 써도 되나요?
주의가 필요합니다. application/x-www-form-urlencoded 방식(폼·쿼리스트링)에서는 +가 공백으로 해석되지만, encodeURIComponent(' ')는 %20을 만듭니다. 반대로 이메일 주소의 +처럼 문자 그대로의 +를 쿼리에 넣을 때는 %2B로 인코딩해야 공백으로 오인되지 않습니다.
What does the URL parser do?
Enter a URL and it splits out the protocol, hostname, port, pathname, hash, and query parameters into a table, using the browser's built-in URL object for accurate parsing.
What happens with multiple or duplicate query parameters?
Parameters with the same name appear as separate rows. For example ?tag=a&tag=b becomes two rows, tag=a and tag=b. Parameters without a value (?flag) show an empty value.
Does it handle URLs without a port or query?
Yes. If the port is omitted the port field is left blank, and if there are no query parameters it shows "No query parameters".
What happens with an invalid URL?
If the browser's URL constructor fails to parse the input (missing protocol or malformed), an error message "Not a valid URL" is shown. You must include http:// or https:// in the input.
Is my URL sent to a server?
No. Parsing uses only the browser's built-in URL object; your URL is never uploaded or stored.
What components make up a URL?
Per RFC 3986, a URL (URI) consists of five parts — scheme, authority (userinfo, host, port), path, query, and fragment. Only the fragment stays in the browser and is never sent to the server.
Why is percent-encoding (%20, etc.) needed?
Characters outside letters, digits, and a few symbols (spaces, non-ASCII text, &, ?, # etc.) have special meaning or aren't allowed in URL syntax, so they must be percent-encoded (% plus two hex digits). Without encoding, an & can be misread as a parameter separator or a space can truncate the URL.
Can I use + for a space in a query string?
Not always — be careful. In form-encoded query strings (application/x-www-form-urlencoded), + is decoded as a space, while encodeURIComponent(' ') produces %20. A literal + (as in an email address) sent in a query must be encoded as %2B or it will be read as a space.