Quick Start

JWT (JSON Web Token) is commonly used for authentication. On HeronTool, you can use the JWT Encoder to generate tokens and the JWT Decoder to parse them.

Step 1: Encode JWT

  1. Visit the JWT Encoder page on HeronTool.
  2. Fill in the Header field, e.g., {"alg":"HS256","typ":"JWT"}.
  3. Fill in the Payload field, e.g., {"user_id":123,"exp":1750000000}.
  4. Enter the secret key and select the algorithm (e.g., HS256).
  5. Click the "Generate" button to obtain the encoded JWT string.

Step 2: Decode JWT

  1. Open the JWT Decoder page on HeronTool.
  2. Paste the JWT string into the input box.
  3. Click the "Decode" button to view the Header, Payload, and signature.
  4. To verify the signature, enter the same secret and algorithm, then click "Verify".

FAQ

Q: Why does decoding show an invalid signature?
A: Check that the secret and algorithm match those used for encoding. HS256 requires the same secret; RS256 requires the public key.

Q: Can JWT contain sensitive information?
A: Not recommended. The Payload is Base64-encoded and can be easily decoded; avoid storing passwords or sensitive data.

Q: How to set an expiration time?
A: Add an exp field (Unix timestamp) to the Payload. The decoder can automatically validate it.

Summary

HeronTool's JWT tools make encoding and decoding simple and intuitive. Whether for development debugging or learning JWT structure, you can get started quickly.