Skip to content

Repository files navigation

πŸ›‘οΈ JWT Decoder & Inspector

πŸš€ High-Performance, 100% Client-Side JSON Web Token Inspector & Validator

Zero Server Calls β€’ Zero Data Logging β€’ Instant Offline-Ready In-Browser Decoding

Live Demo GitHub LinkedIn Instagram Facebook


License: MIT TypeScript React Vite Tailwind CSS Tests Client-Side Privacy


πŸ”— Try Live Demo β€’ πŸ“– Documentation β€’ ⚑ Quick Start β€’ πŸ§ͺ Testing β€’ 🌐 Socials


Important

πŸ”’ 100% Client-Side Privacy Guarantee
Your tokens, keys, and payload claims never leave your browser. All Base64Url parsing, UTF-8 conversion, JSON syntax highlighting, and timestamp checks are computed locally in client-side memory using the web browser's native engine. No backend API or third-party tracking is used.


🌟 Key Features

⚑ Instant Local Decoding

Decodes standard JWTs in real-time as you type. No submit button required. Full offline support after dependency installation.

🎨 Color-Coded Token Breakdown

Visually segments tokens into HEADER, PAYLOAD, and SIGNATURE with live character counts and byte sizes.

⏰ Live Timestamp Evaluation

Real-time relative calculation for exp (Expiration), nbf (Not Before), and iat (Issued At) with auto-ticking relative tags (e.g. "Expired 2 hours ago", "Expires in 3 days").

πŸ” Deep Claims Inspector

Built-in registry of RFC 7519 & OpenID Connect registered claims with instant search, filtering (All / Standard / Custom), and human-readable descriptions.

🌍 Robust Unicode & Emoji Support

Handles international UTF-8 character encodings (Japanese Kanji, German umlauts, Spanish accents, and emojis) without throwing URIError.

πŸ“‹ One-Click Copy Utilities

One-click clipboard copy for formatted Header JSON, Payload JSON, raw signature segments, and individual claim values with visual feedback.


🧭 Live Demo & Official Reference

You can try the live, fully interactive version of this tool online at:

πŸ”— https://himat.tech/free-tools/jwt-decoder


🧩 Color-Coded Structure Overview

A standard JSON Web Token is comprised of three dot-separated Base64Url-encoded sections:

$$\text{\color{#fb7185}HEADER} \ . \ \text{\color{#c084fc}PAYLOAD} \ . \ \text{\color{#2dd4bf}SIGNATURE}$$

Section Color Purpose Example Contents
Header πŸ”΄ Rose Token type & signing algorithm {"alg": "HS256", "typ": "JWT"}
Payload 🟣 Purple Claims, user identity, & timestamps {"sub": "12345", "name": "Alex", "exp": 1819440000}
Signature 🟒 Teal Binary cryptographic verification digest dBjftJeZ4CVP-mB92K27uhbUJU1p1r...

πŸ” Supported Algorithms for Inspection

Because decoding a standard Base64Url-encoded token structure does not require knowing the signing secret or private key, this application supports decoding tokens from all standard RFC 7518 JWS algorithms:

  • HMAC (Symmetric): HS256, HS384, HS512
  • RSASSA-PKCS1-v1_5 (Asymmetric): RS256, RS384, RS512
  • ECDSA (Asymmetric): ES256, ES384, ES512
  • RSASSA-PSS (Asymmetric): PS256, PS384, PS512
  • Edwards-Curve: EdDSA (Ed25519, Ed448)
  • Unsecured: none

πŸš€ Getting Started

Prerequisites

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher

Installation & Local Setup

  1. Clone the repository:
git clone https://github.com/himat-technology/jwt-decoder.git
cd jwt-decoder
  1. Install dependencies:
npm install
  1. Launch local development server:
npm run dev

Open your browser and navigate to http://localhost:3000.


πŸ—οΈ Production Build

To generate an optimized, zero-dependency static production bundle:

npm run build

The compiled assets will be in the dist/ folder and can be deployed instantly to Vercel, Netlify, Cloudflare Pages, GitHub Pages, or any static file server.

To preview the production build locally:

npm run preview

πŸ§ͺ Running Automated Tests

Run the complete Vitest test suite:

npm run test

To run tests with interactive watch mode:

npm run test:watch

Test Suite Coverage:

  • jwtDecoder.test.ts: ASCII Base64Url decoding, UTF-8 / multi-byte Unicode strings, malformed token sections, invalid Base64, and JSON syntax errors.
  • jwtValidation.test.ts: Algorithm metadata, RFC 7519 standard claims vs. custom application claim detection.
  • timestampUtils.test.ts: Human-readable date formatting, exp expiration logic, nbf future/active validation, and relative time calculations.

πŸ“ Architecture & File Structure

jwt-decoder/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Header.tsx              # Sticky brand navbar with client-side status & socials
β”‚   β”‚   β”œβ”€β”€ JwtInput.tsx            # Live JWT textarea, sample selector, paste & clear
β”‚   β”‚   β”œβ”€β”€ TokenStructure.tsx      # Color-coded token breakdown (Header.Payload.Signature)
β”‚   β”‚   β”œβ”€β”€ JsonViewer.tsx          # Syntax-highlighted JSON viewer with line numbers & copy
β”‚   β”‚   β”œβ”€β”€ ClaimInspector.tsx      # Claims explorer with search, filters, and RFC descriptions
β”‚   β”‚   β”œβ”€β”€ TimestampStatus.tsx     # Real-time auto-updating timestamp cards (exp, nbf, iat)
β”‚   β”‚   β”œβ”€β”€ CopyButton.tsx          # Accessible clipboard copy button with feedback
β”‚   β”‚   β”œβ”€β”€ FeatureSection.tsx      # 6 core feature showcase cards
β”‚   β”‚   β”œβ”€β”€ HowItWorks.tsx          # 3-step walkthrough guide
β”‚   β”‚   β”œβ”€β”€ FAQ.tsx                 # Accordion FAQ answering security & algorithm questions
β”‚   β”‚   └── Footer.tsx              # Security disclaimers, links & credits
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── useJwtDecoder.ts        # Custom hook for reactive decoding & 5s timestamp ticker
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ jwtDecoder.ts           # Base64Url decoding, UTF-8 parsing, and diagnostics
β”‚   β”‚   β”œβ”€β”€ jwtValidation.ts        # RFC 7519 / OIDC claim registry and algorithm metadata
β”‚   β”‚   β”œβ”€β”€ timestampUtils.ts       # Human date formatting, relative time calculation
β”‚   β”‚   β”œβ”€β”€ sampleJwt.ts            # High-quality standard, expired, and unicode demo tokens
β”‚   β”‚   └── __tests__/              # Comprehensive Vitest unit test suite
β”‚   β”‚       β”œβ”€β”€ jwtDecoder.test.ts
β”‚   β”‚       β”œβ”€β”€ jwtValidation.test.ts
β”‚   β”‚       └── timestampUtils.test.ts
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── jwt.ts                  # Comprehensive TypeScript interfaces
β”‚   β”œβ”€β”€ App.tsx                     # Main page orchestrator
β”‚   β”œβ”€β”€ main.tsx                    # React DOM root mounting
β”‚   └── index.css                   # Global Tailwind CSS and custom styling
β”œβ”€β”€ public/
β”‚   └── favicon.svg                 # Custom SVG brand favicon
β”œβ”€β”€ package.json                    # Project dependencies and npm scripts
β”œβ”€β”€ vite.config.ts                  # Vite + Vitest config
β”œβ”€β”€ tsconfig.json                   # Strict TypeScript configuration
β”œβ”€β”€ tsconfig.node.json              # TypeScript Node bundler config
β”œβ”€β”€ tailwind.config.js              # Color palette, dark theme, and fonts
β”œβ”€β”€ postcss.config.js               # PostCSS setup
β”œβ”€β”€ eslint.config.js                # ESLint configuration
β”œβ”€β”€ README.md                       # Comprehensive documentation
└── .gitignore                      # Git ignored files

⚠️ Security Notice

Warning

Decoding is NOT Cryptographic Verification:
Decoding a JSON Web Token merely reveals what is encoded in its header and payload. Anyone can fabricate or alter an unverified payload. Never trust unverified JWT payloads in backend authorization decisions without cryptographically validating the signature with your secret key (HMAC) or public key (RSA/ECDSA).


🌐 Community & Connect

Stay connected with HiMat Technology for updates, developer tools, and open-source releases:

Platform Link
🌐 Official Website himat.tech
⚑ Live JWT Tool himat.tech/free-tools/jwt-decoder
πŸ™ GitHub @himat-technology
πŸ’Ό LinkedIn company/himat-technology
πŸ“Έ Instagram @himat_technologies
πŸ“˜ Facebook Himat-technology


πŸ“„ License

This project is licensed under the MIT License β€” free for personal and commercial use.

Built with ❀️ by HiMat Technology

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages