🔓 JWT 디코더
온라인으로 JSON 웹 토큰(JWT)을 디코딩하고 검증합니다.
토큰 정보
길이
0
Header 크기
0 B
Payload 크기
0 B
서명 크기
0 B
Header
Payload
Signature
JWT 정보
✓ JWT(JSON Web Token)는 네트워크에서 정보를 안전하게 전송하는 개방형 표준
✓ Header, Payload, Signature 3부로 구성
✓ 인증 및 인가(API 인증)에 사용
✓ 이 도구는 JWT를 디코드하지만 서명은 확인하지 않음
✓ JWT 토큰을 붙여넣으면 자동으로 디코드
✓ Copy를 클릭하여 빠르게 복사
사용법
기능 소개
- ✓ JWT 토큰 디코딩
- ✓ 헤더 및 페이로드 보기
- ✓ 서명 확인
- ✓ HS256/RS256 지원
- ✓ 토큰 검증
단계
- JWT 토큰 붙여넣기
- 토큰이 자동으로 디코딩됨
- 헤더와 페이로드를 개별적으로 보기
- 서명 확인(선택 사항)
- 디코딩된 부분 복사
📚 전체 가이드
JWT 디코더란 무엇인가요?
JWT 디코더는 JSON Web Token(JWT)의 내용을 쉽게 읽고 검증할 수 있도록 해주는 온라인 웹 기반 도구입니다. JWT는 클라이언트와 서버 간에 정보를 안전하게 전송하기 위한 개방형 표준(RFC 7519)으로, 주로 사용자 인증 및 권한 부여에 사용됩니다. 이 도구는 암호화된 형식으로 된 JWT 문자열을 입력받아, 그 안에 담긴 헤더(Header), 페이로드(Payload), 서명(Signature)의 구성 요소를 사람이 읽을 수 있는 형태로 분해하고 디코딩하여 보여줍니다.
주요 목적
이 도구의 주요 목적은 개발과 디버깅 과정을 간소화하는 것입니다. 개발자는 인증 흐름을 확인하거나, 토큰에 포함된 클레임(사용자 정보, 권한, 만료 시간 등)을 빠르게 점검할 필요가 있습니다. JWT 디코더를 사용하면 복잡한 코드를 작성하거나 명령줄 도구를 사용하지 않고도 브라우저에서 즉시 토큰의 내부 구조를 확인할 수 있어 시간을 절약하고 오류를 쉽게 찾을 수 있습니다.
주요 기능
- 토큰 분해 및 가독성 향상: 점('.')으로 구분된 JWT 문자열의 세 부분(헤더, 페이로드, 서명)을 자동으로 분리하고, Base64Url로 인코딩된 헤더와 페이로드 부분을 JSON 형식으로 디코딩하여 보기 좋게 정렬하여 표시합니다.
- 클레임 검사: 페이로드 섹션에 포함된 표준 클레임(예: iss(발행자), exp(만료 시간), sub(주제))과 사용자 정의 클레임을 명확하게 보여줍니다.
- 서명 검증 알림: 대부분의 온라인 디코더는 서명의 유효성을 직접 검증하지는 않지만(비밀키나 공개키가 필요함), 서명 부분이 존재하는지 여부를 표시하고 서명 검증이 필요하다는 점을 안내합니다.
- 사용자 친화적 인터페이스: 간단한 텍스트 입력창에 JWT를 붙여넣기만 하면 결과가 즉시 색상 구분이나 들여쓰기 등으로 가독성 있게 출력됩니다. 별도의 소프트웨어 설치가 필요 없습니다.
- 디버깅 지원: 만료된 토큰, 잘못된 형식의 토큰, 또는 예상치 못한 클레임 값을 빠르게 확인하여 애플리케이션의 인증 관련 문제를 해결하는 데 도움을 줍니다.
-
JWT 구조를 명확하게 확인하고 디버깅
헤더(Header), 페이로드(Payload), 서명(Signature)으로 구성된 JWT 토큰을 분해하여 각 부분의 내용을 직관적으로 확인할 수 있습니다. 개발 중 토큰에 어떤 클레임이 포함되어 있는지, 알고리즘이 올바르게 설정되었는지 빠르게 검증하는 데 필수적입니다. -
클라이언트 측에서 사용자 정보 안전하게 추출
서버에 추가 요청 없이도 토큰의 페이로드(Payload)를 디코딩하여 사용자 ID, 권한(roles), 만료 시간(exp) 같은 정보를 안전하게 읽을 수 있습니다. 예를 들어, 프론트엔드 애플리케이션에서 토큰의 'userRole' 클레임을 확인해 관리자 페이지 접근 권한을 UI에 반영할 때 유용합니다. -
토큰 만료 및 유효성 사전 점검
디코딩을 통해 토큰의 만료 시간(`exp` claim)을 미리 확인하여, 이미 만료된 토큰으로 API 요청을 보내는 무의미한 시도를 방지할 수 있습니다. 사용자 세션 타임아웃을 예측하고 갱신 알림을 표시하는 등 사용자 경험을 개선하는 시나리오에 활용됩니다. -
다양한 언어 및 환경 간 호환성 검증
백엔드(예: Java Spring, Node.js)에서 생성한 토큰이 모바일 앱(Android/iOS)이나 다른 마이크로서비스에서 정상적으로 읽히는지 검증할 때 유용합니다. 표준(JWT RFC 7519)에 따른 상호 운용성을 보장하는 도구로 사용됩니다. -
보안 및 교육 목적의 토큰 분석
실제 인증 흐름에서 전송되는 토큰의 내용을 살펴보며, 민감한 정보가 페이로드에 포함되지 않았는지 검토하는 보안 모범 사례를 학습할 수 있습니다. 개발자 교육 시 JWT의 동작 원리를 설명하는 데 효과적인 도구입니다. -
API 테스트 및 문제 해결 지원
Postman이나 클라이언트 애플리케이션에서 받은 에러 응답(예: 401 Unauthorized)의 원인을 분석할 때, 관련 JWT 토큰을 디코딩하여 클레임 오류나 만료 문제를 신속하게 진단하고 해결할 수 있습니다.
토큰 검증은 디코딩과 다릅니다
JWT 디코더는 단순히 Base64Url로 인코딩된 헤더와 페이로드를 읽기 쉬운 형태로 변환할 뿐입니다. 서명 검증(Signature Verification)을 수행하지 않으므로, 디코딩된 정보가 변조되지 않았음을 보장할 수 없습니다. 실제 인증/인가 로직에서는 반드시 서버 측에서 공개키 또는 비밀키를 사용해 서명을 검증해야 합니다.
민감한 정보는 페이로드에 저장하지 마세요
JWT 페이로드는 인코딩되어 있지만 암호화되지 않습니다. 누구나 쉽게 디코딩하여 내용을 볼 수 있습니다. 따라서 비밀번호, 주민등록번호, 신용카드 번호 등의 민감 데이터는 절대로 JWT에 포함해서는 안 됩니다. 사용자 식별자(ID), 역할(role), 만료 시간(exp)과 같은 최소한의 필요한 정보만 담아야 합니다.
만료 시간(exp) 클레임을 항상 설정하고 확인하세요
JWT의 가장 큰 위험 중 하나는 한번 발급되면 취소하기 어렵다는 점입니다. 이를 완화하기 위해 반드시 짧은 만료 시간(exp 클레임)을 설정하고, 클라이언트 또는 리소스 서버에서 이 값을 꼭 확인해야 합니다. 장기 생명 주기가 필요한 경우 리프레시 토큰(Refresh Token) 방식을 도입하는 것이 좋습니다.
알고리즘(alg) 클레임을 강제로 확인하세요
JWT 헤더의 'alg' 값은 어떤 서명 알고리즘을 사용했는지 명시합니다. 서명 검증 시 이 값을 반드시 확인하고, 애플리케이션에서 허용하는 알고리즘(예: RS256)만 허용하도록 강제해야 합니다. 'alg'를 'none'으로 설정하는 등의 취약점 공격을 방지할 수 있습니다.
디버깅과 개발 시 유용하게 활용하세요
JWT 디코더는 개발 단계에서 매우 유용한 도구입니다.
- 발급된 토큰의 구조와 클레임 내용을 빠르게 확인하여 로직 오류를 디버깅합니다.
- 토큰의 만료 시간이 올바르게 설정되었는지 확인합니다.
- 클라이언트 애플리케이션에서 전송받은 토큰의 무결성을 사전 점검합니다.
공개 클레임 이름은 표준을 따르세요
JWT의 페이로드에는 공개 클레임(Registered Claims), 공개 클레임(Public Claims), 비공개 클레임(Private Claims)이 있습니다. 사용자 정의 클레임을 추가할 때는 가능한 한 표준화된 공개 클레임 이름(IANA JWT 레지스트리 참고)을 사용하거나, 충돌을 방지하기 위해 URI 형식의 네임스페이스를 사용하는 것이 좋습니다.
What is a JWT and why would I need to decode it?
A JWT (JSON Web Token) is a compact, URL-safe token used to securely transmit information between parties as a JSON object. It is commonly used for authentication and authorization in web applications and APIs. You need to decode a JWT to view its contents, which are typically encoded. Decoding allows you to inspect the payload (claims like user ID, expiration) and verify the header to understand the token's structure and validity without needing the secret key used to sign it.
What is the difference between decoding and verifying a JWT?
Decoding a JWT means converting the Base64Url-encoded parts (header and payload) into readable JSON. This is a public operation that anyone can perform on any token. Verifying a JWT is a security-critical step that checks the token's signature using a secret or public key to ensure it was issued by a trusted source and hasn't been tampered with. This tool performs decoding for inspection; for full security verification in a production environment, you must use your backend with the correct secret key.
What are the main parts of a decoded JWT?
A decoded JWT consists of three distinct parts, separated by dots in the encoded string. The Header contains metadata about the token type and the signing algorithm used (e.g., HS256, RS256). The Payload contains the "claims" or statements about an entity (typically the user) and additional data like issuer, subject, and expiration time. The Signature is used to verify that the sender of the JWT is who it says it is and to ensure the message wasn't changed along the way. When decoded, you can read the header and payload as JSON objects.
My token shows "Invalid token format." What does this mean?
This error indicates that the provided string does not conform to the standard JWT structure. A valid JWT must have three parts (header, payload, signature) separated by two dots (e.g., xxxxx.yyyyy.zzzzz). Common causes include: pasting an incomplete token, including extra characters like quotation marks, pasting an encrypted token (like a session cookie) instead of a JWT, or using a token that has been malformed. Ensure you are copying the full, exact token string from your application's request headers or storage.
What are common claims found in the JWT payload?
Claims are key-value pairs in the payload. Common registered claims include: iss (issuer), sub (subject, often a user ID), aud (audience), exp (expiration time, as a Unix timestamp), nbf (not before time), and iat (issued at time). Applications often add custom (private) claims like username, roles, or email to convey user-specific information. Decoding the payload allows you to see all these claims.
Is it safe to decode JWTs with online tools?
Decoding a JWT (reading the header and payload) is inherently safe as this data is only Base64Url encoded, not encrypted. Anyone with the token can decode it. However, you should never use an online tool to verify a signature with your secret or private key, as this requires sending the key to a third-party server, which is a major security risk. For inspection and debugging of non-sensitive tokens, decoding is fine. For production verification, always use trusted, server-side libraries.
What does the "alg" field in the header mean?
The "alg" (algorithm) field in the JWT header specifies the cryptographic algorithm used to sign the token, such as HS256 (HMAC with SHA-256) or RS256 (RSA with SHA-256). This tells the verifier which method to use to check the signature. It's crucial that your application validates this field and does not accept tokens with unexpected or "none" algorithms, as this can be a security vulnerability allowing token forgery.