A simple command-line JSON Web Tokens decoder tool.
- Accepts JWT tokens via command-line arguments or standard input
- Cleans tokens (removes Bearer prefix, whitespace, newlines)
- Formats timestamps (
exp,nbf,iat) as human-readable dates
brew tap dandehoon/tools
brew install jwtdNote: Works on macOS and Linux (with Homebrew/Linuxbrew)
Download and install the latest release directly from GitHub:
curl -sSL https://raw.githubusercontent.com/dandehoon/jwtd/main/install.sh | sudo bashIf you have Go installed:
go install github.com/dandehoon/jwtd@latest- Go to the releases page
- Download the appropriate binary for your platform
- Make it executable and move it to a directory in your PATH
-
Use the tool: You can provide the JWT token in two ways:
Pass the JWT token directly as a command-line argument:
jwtd "your.jwt.token"The tool accepts tokens in various formats:
# Standard JWT token jwtd "your.jwt.token" # With Bearer prefix jwtd "Bearer your.jwt.token" # With any custom prefix, extra spaces, or newlines jwtd " JWT your.jwt.token "
Pipe the JWT into the program via standard input:
echo "your.jwt.token" | jwtd
The tool accepts tokens in various formats:
# Standard JWT token echo "your.jwt.token" | jwtd # With Bearer prefix echo "Bearer your.jwt.token" | jwtd # With any custom prefix, extra spaces, or newlines echo " JWT your.jwt.token " | jwtd
Tip for macOS users: You can use
pbpasteto pipe the content of your clipboard directly:pbpaste | jwtdExamples:
Using command-line argument:
jwtd "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"Using pipe input:
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" | jwtd
Both methods will output:
alg: HS256 typ: JWT --- iat: 1516239022 (2018-01-18T01:30:22Z) name: John Doe sub: 1234567890
If you prefer to build from source:
go build -o jwtd main.goThen you can run it using ./jwtd.
Testing the Homebrew formula:
make test-brewThis will audit the formula and test installation.
This project is licensed under the MIT License - see the LICENSE file for details.