A simple, fast, and SEO-friendly web application to generate (sign) and verify JSON Web Tokens (JWTs) directly in your browser. Built with vanilla HTML, CSS, and JavaScript, using crypto-js
for cryptographic operations and PrismJS
for syntax highlighting.
Live Demo: [Link to your deployed GitHub Pages site here]
- Sign JWTs:
- Provide custom Header (JSON)
- Provide custom Payload (JSON)
- Enter a Secret Key (kept client-side)
- Select Algorithm: HS256, HS384, HS512
- Real-time JSON validation and syntax highlighting.
- Header
alg
property automatically updated based on selection.
- Verify JWTs:
- Input a JWT string.
- Provide the Secret Key used for signing.
- Displays decoded Header and Payload with syntax highlighting.
- Shows clear verification status (Valid / Invalid).
- Secure: All operations (signing, verification, secret handling) happen entirely within your browser. Secrets are never sent to any server.
- Fast & Lightweight: No heavy frameworks, just plain web technologies.
- SEO Friendly: Includes relevant meta tags for search engines.
- Responsive: Basic responsiveness for use on different screen sizes.
- Toggle Secret Visibility: Option to show/hide secret keys.
- Clone or download this repository.
- Open the
index.html
file directly in your web browser. No build step or server needed for local use.
OR
- Deploy the contents (
index.html
,styles.css
,app.js
) to a web server or static hosting platform like GitHub Pages.
- Navigate to the "Sign JWT" tab.
- Modify the default Header JSON or enter your own. Ensure it's valid JSON. The
alg
property will be automatically set based on the dropdown selection. - Enter your Payload JSON. Ensure it's valid JSON.
- Enter your Secret Key in the designated input field.
- Select the desired signing algorithm (HS256, HS384, HS512) from the dropdown.
- Click "Generate JWT".
- The generated JWT will appear in the output box below.
- Navigate to the "Verify JWT" tab.
- Paste the JWT string you want to verify into the "JWT Token" input field.
- Enter the Secret Key that was originally used to sign the JWT.
- Click "Verify JWT".
- The verification status (Valid/Invalid) and the decoded Header and Payload will be displayed below.
This project is ready to be deployed on GitHub Pages:
- Create a new repository on GitHub (e.g.,
jwt-signer-verifier
). - Push the
index.html
,styles.css
, andapp.js
files to the main branch of your repository. - Go to your repository settings on GitHub.
- Navigate to the Pages section (usually under "Code and automation").
- Under "Build and deployment", select Deploy from a branch as the source.
- Choose the
main
branch (or whichever branch you pushed to) and the/ (root)
folder. Click Save. - GitHub Pages will build and deploy your site. The URL will be provided in the Pages settings (usually
https://yourgithubusername.github.io/repository-name/
). - (Optional but Recommended): Update the
og:url
andog:image
meta tags inindex.html
to point to your live GitHub Pages URL and potentially an image hosted in the repo. You might also want to add afavicon.ico
.
This project is open source. Feel free to use, modify, and distribute. (Consider adding a specific license like MIT if desired).