Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
  1. Home
  2. Converters & Encoders
  3. JWT Builder
Add to favorites

Loading tool...

You might also like

JWT Decoder

Decode and inspect JSON Web Tokens (JWT). View header, payload, claims, expiration status, and signature without needing the secret key

PDF Signature Tool

Add your signature to PDF documents. Draw, type, or upload your signature, then position it anywhere on the page. Perfect for contracts, agreements, and official documents.

QR Code Generator

Generate QR codes from text or URLs

About JWT Builder

Create and sign JSON Web Tokens (JWT) directly in your browser with our free JWT Builder, perfect for generating test tokens, learning JWT structure, and debugging authentication systems. This tool allows you to build JWTs with custom claims, set expiration times, and sign them with HMAC algorithms without leaving your browser. All signing happens client-side using the Web Crypto API, meaning your secret key never leaves your device and is never sent to any server. JWTs are essential for modern API authentication, microservices communication, and stateless authentication systems—building tokens directly lets you test authentication flows, verify token validation logic, and understand how claims propagate through systems. The tool provides preset buttons for standard claims (issuer, subject, expiration, issued-at), preset expiration times (15 minutes to 30 days) for common scenarios, and a full JSON editor for custom claims. Color-coded token display shows the three JWT components clearly, and real-time generation updates the token as you make changes. Whether you're developing API authentication, testing token validation, learning JWT concepts, preparing demos, or debugging multi-service authentication flows, the JWT Builder provides an essential, secure toolset.

How to Use

  1. 1Select signing algorithm (HS256 recommended)
  2. 2Enter your secret key
  3. 3Edit the payload JSON with your claims
  4. 4Use quick buttons to add standard claims
  5. 5Set expiration time with preset buttons
  6. 6Copy the generated token

Key Features

  • HMAC algorithms (HS256, HS384, HS512)
  • Custom payload editor with JSON validation
  • Quick add standard claims (iss, sub, exp, iat, etc.)
  • Preset expiration times (15m, 1h, 24h, 7d, 30d)
  • Color-coded token display
  • Real-time token generation
  • Client-side signing for security

Common Use Cases

  • Creating test tokens for API development

    Generate sample JWT tokens with custom claims to test API endpoints and authentication middleware without connecting to a real auth server.

  • Generating auth tokens for debugging

    Build tokens with specific claims to reproduce authentication issues, test claim-based authorization logic, and debug token handling in applications.

  • Learning JWT structure and claims

    Understand JWT architecture by building tokens, inspecting their structure, and seeing how claims are represented in the signed token.

  • Preparing demonstrations and demos

    Generate realistic JWT examples for presentations, training, and documentation showing how JWT tokens work and what claims look like.

  • Testing JWT validation and claims checking

    Create tokens with various claim combinations to test whether validation logic correctly accepts valid tokens and rejects tokens with missing or incorrect claims.

  • Microservice authentication flow testing

    Generate test tokens for debugging multi-service authentication flows, testing claim propagation between services, and verifying token handling at each step.

Understanding the Concepts

Building JSON Web Tokens is a critical step in developing and testing any authentication system that relies on token-based authorization. While JWT decoding is a passive inspection activity, JWT building requires understanding the full token lifecycle: how claims are structured, how signing algorithms work, how expiration is managed, and how the resulting token integrates with the receiving system's validation logic.

The signing process is the heart of JWT creation. For HMAC-based algorithms (HS256, HS384, HS512), the signer computes a Hash-based Message Authentication Code over the Base64URL-encoded header and payload, using a shared secret key. HMAC combines the hash function with the key in a specific way that prevents length extension attacks, a vulnerability that affects naive hash-based authentication schemes. HS256 uses SHA-256 internally and produces a 256-bit signature, providing a security level widely considered sufficient for most applications. HS384 and HS512 use SHA-384 and SHA-512 respectively, offering higher security margins for applications that require them.

The secret key used for HMAC signing deserves careful consideration. A weak or short key undermines the entire security model—if an attacker can guess or brute-force the key, they can forge arbitrary tokens with any claims they choose. Security best practices recommend keys of at least 256 bits (32 bytes) of cryptographic randomness for HS256, equivalent in entropy to the hash function's output. Using predictable values like "secret," "password," or short strings as signing keys is a common and dangerous mistake in production systems.

Token expiration management is another crucial aspect of JWT building. The "exp" claim specifies the timestamp after which the token should be rejected, expressed as a Unix timestamp (seconds since January 1, 1970 UTC). Choosing appropriate expiration times involves balancing security against user experience. Short-lived tokens (5–15 minutes) minimize the window of vulnerability if a token is compromised, but require frequent renewal. Long-lived tokens (days or weeks) reduce authentication friction but increase risk. Many systems use a two-token pattern: a short-lived access token for API authorization paired with a longer-lived refresh token that can obtain new access tokens.

The "iat" (issued at) claim records when the token was created, enabling receiving systems to reject tokens that are "too old" even if they haven't technically expired. The "nbf" (not before) claim specifies a time before which the token should not be accepted, useful for tokens that are generated in advance for future use. Together, these time-based claims create a precise validity window that receiving systems can enforce.

In development and testing workflows, JWT builders serve as essential diagnostic tools. When an API returns a 401 Unauthorized response, the ability to construct a token with specific claims and test whether the API accepts it is invaluable for isolating whether the issue is in token generation, token validation, or the claims themselves. Mock tokens with controlled claims allow systematic testing of authorization logic—verifying that admin roles grant access to admin endpoints, that expired tokens are properly rejected, and that missing required claims trigger appropriate error responses.

Frequently Asked Questions

Is it safe to create JWTs in the browser?

Yes, all signing happens client-side. Your secret key never leaves your browser. However, for production, use server-side signing.

Why only HMAC algorithms?

HMAC (symmetric) algorithms can be implemented with WebCrypto. Asymmetric algorithms (RS256) require private key handling which is more complex.

Privacy First

All processing happens directly in your browser. Your files never leave your device and are never uploaded to any server.