Tiny Online Tools logoTiny Online Toolssearch搜索工具…grid_view全部工具
首页chevron_right开发者工具chevron_rightJWT 生成器与解码器JWT 生成器与解码器

JWT 生成器与解码器

使用 HMAC 生成并签名 JSON Web Token,或解码任意 JWT。

key生成lock_openDecode
warningSignature is 未验证 here — this tool only decodes the header and payload for inspection purposes.

相似工具

JWT 签名验证器

JWT 签名验证器

在浏览器中本地验证 HMAC JWT 签名。

JSON 验证器

JSON 验证器

验证 JSON syntax quickly.

JWT 解码器

JWT 解码器

解码并检查 JWT 令牌。

PBKDF2 生成器

PBKDF2 生成器

在浏览器中使用 PBKDF2 从密码派生加密密钥。

PNG转WebP

PNG转WebP

将PNG图片转换为优化的WebP格式。

许可证密钥生成器

许可证密钥生成器

生成具有可配置段数、长度、分隔符和字符集的软件许可证密钥。

解锁 PDF

解锁 PDF

在本地移除 PDF 的密码保护。

apps

更多工具

浏览我们完整的免费在线工具集合。

生成 & 解码 JWTs for Authentication Testing

JSON Web Tokens (JWTs) are the standard for API authentication and authorization. Whether you're building an auth system, testing token flows, or debugging authentication issues, you need a way to quickly 创建 and inspect JWTs without writing code.

This JWT Generator lets you 创建 tokens with custom headers and payloads, sign them with HMAC secrets, and instantly inspect any JWT by decoding it. Test your authentication before deploying, verify token structure without extra tools, and debug token-related issues faster.

生成 Custom JWTs

Define your token in three parts:

Header: Standard JWT header fields identifying the token type and hashing algorithm. Edit the JSON to customize if needed, though defaults work for most cases.

Payload: The actual token data—user ID, claims, roles, expiration time, etc. Define whatever claims your application expects. The tool accepts any valid JSON.

Secret Key: The HMAC secret used to sign the token. This is crucial: use the same secret when validating tokens in your application. The tool never sends this anywhere—it stays in your 浏览器.

Click 生成, and you instantly get a valid, signed JWT ready to use in testing.

Three HMAC Algorithms Supported

HS256 (HMAC-SHA-256): The most common choice. Balances security and performance.

HS384 (HMAC-SHA-384): Stronger hashing for higher security requirements.

HS512 (HMAC-SHA-512): Maximum security with SHA-512 hashing.

Choose based on your application's security needs.

解码 Any JWT

Have a JWT from an API response or log? Paste it in the 解码 section and instantly see the 解码d header and payload. This is invaluable for:

  • Inspecting API Responses: Extract the JWT from an authentication response and see what claims it contains
  • Debugging Auth Issues: Check if a token has the expected user ID, roles, expiration time, etc.
  • Verifying Token Structure: Ensure your auth server is issuing tokens with the correct 格式化
  • Token Analysis: See at a glance what data a token carries

Note: Decoding doesn't verify the signature—it just extracts and displays the data. This is safe for inspection but doesn't prove the token is valid.

Color-Coded Token Display

When you 生成 a JWT, it's displayed with color coding showing the three segments:

  • Header segment in one color
  • Payload segment in another
  • Signature segment in a third

This makes it easy to spot which part is which and understand the token structure.

Common Testing Scenarios

Auth Flow Testing: 生成 tokens with different payloads and test how your application handles them. 创建 tokens with various expiration times, roles, or user IDs without needing a full auth server.

Bearer Token Validation: 生成 a token, copy it, add it as a Bearer token to API requests, and verify your authorization middleware accepts it.

Token Claims Verification: Test that your application correctly extracts and uses claims from tokens by generating tokens with specific claim values and checking if your app processes them correctly.

Security Testing: 生成 tokens with expired timestamps or invalid signatures (by using different secrets) to test how your app handles invalid tokens.

100% 浏览器-Based, Completely Secure

All JWT generation and decoding happens in your 浏览器 using the native Web Crypto API. Your secrets never leave your machine, and your 生成d tokens aren't sent anywhere. This is safe for testing with production secret values—they never touch an external server.

Copy & Use Immediately

生成d JWTs copy with one click. Paste directly into API request headers or tool test fields without additional 格式化ting.