Skip to content
Quick and lightweight jwt generator (console)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


What is it?

Jwtgen is a quick and lightweight jwt generator (console-only). You give it your desired token parameters like issuer, various claims, etc... and it spits out an encoded jwt.

How to use it


  • Open explorer.exe and navigate to the folder where jwtgen.exe resides.
  • Click on the navigation bar and replace the path with cmd and hit enter.
  • In the command line interface, you can now start jwtgen.exe with your desired arguments
    • jwtgen.exe -iIssuerName -sJohnDoe --exp=1587399600 --claim=role:admin --claim=age:23 -kSuperSafeHmacSecret123 --alg=HS256


  • Open your terminal and cd into the directory where the jwtgen executable resides.
  • Execute jwtgen with your desired token claims and arguments:
  • ./jwtgen --iss=IssuerName --sub=JohnDoe --exp=1587399600 --alg=RS512 --copy --key=/home/username/path/to/public-rsa-key.pem

What are the parameters

  • -h, --help
    • Print usage and exit.
  • -c, --copy
    • Copy generated token to clipboard automatically.
  • -i, --iss
    • The jwt's issuer (name of who created/signed this token).
  • -s, --sub
    • The jwt's sub claim (usually whom this token refers to).
  • -a, --aud
    • The jwt's intended audience (recipients). Should represent who or what this token is intended for. Optional, according to RFC7519.
  • --exp
    • The jwt's expiration date in numeric date format, meaning the amount of SECONDS SINCE 1970-01-01T00:00:00Z UTC according to the RFC7519 standard. You can use to your advantage.
  • --iat
    • The numeric date format of when this token was issued. If you don't pass this argument, it defaults to the current time in UTC.
  • --nbf
    • Datetime of when the jwt starts being valid (in numeric date format, just as in the --exp argument).
  • --claim
    • Put as many claims in as you need. Specify them with the syntax "--claim=CLAIM_NAME:CLAIM_VALUE" (without quotation marks).
  • --alg
    • The algorithm to use for signing the token. Can be HS256, HS384, HS512, RS256, RS384 or RS512.
  • -k, --key
    • The secret string to use for signing the token (when selected an HMACSHA algo) OR the file path to the private RSA key used for signing the token (for RSASHA algorithms) - the file must be a text file containing the private key in PEM format. If omitted, the token won't be signed at all (the --alg argument is ignored in that case).
  • -p, --pw
    • Password for decrypting the RSA key (if the key requires one).

How to build from source


Note: I included a .zip with pre-built OpenSSL binaries inside dependencies/openssl if you don't wanna build it on your own. Check out the inside that folder for more information.

Building OpenSSL from source

This is only the default way to approach this, the full, official guide on how to build OpenSSL from source obviously contains way more customization options. But if you just want to build jwtgen and carry on with your life, here's a bunch of quick instructions on how to build it on the various platforms:

Windows (64-bit)

To build OpenSSL on Windows, you need to have ActiveState Perl installed, NASM and MSVC on Windows or GCC/G++ on Unix respectively.

Open the x64 developer's command prompt: open start menu, search for "x64" and then run the native dev command prompt as an administrator. Make absolutely sure that you are on x64!

cd C:\path\to\where\your\third-party\git\repos\are
git clone
cd openssl
git checkout OpenSSL_1_1_1-stable
perl Configure VC-WIN64A
nmake test
nmake install
Linux and macOS (64-bit)

To build OpenSSL on Unix, make sure that you have your compilers set up (GCC/G++). E.g. sudo apt-get install build-essential or the XCode/command-line tools on macOS

cd ~/path/to/where/you/store/your/third-party/git-repos
git clone
cd openssl
git checkout OpenSSL_1_1_1-stable
make test
sudo make install

Build jwtgen

  • Make sure you have CMake installed on your system (either build it from source and add it to your environment's path or use pre-built binaries).
  • Open cmd.exe and navigate to a folder where you want jwtgen to clone into.
  • git clone
  • cd jwtgen
  • mkdir build && cd build
  • cmake ..
    • make for Linux or macOS
    • For Windows, use msbuild or just open jwtgen.sln in Visual Studio, select Release mode (x64) and build the solution from there.
      • On Windows, you need to copy OpenSSL's libcrypto-1_1-x64.dll from the OpenSSL installation path's bin/ folder into jwtgen/build/Release
      • Usually, the OpenSSL installation path on Windows is C:\Program Files\OpenSSL
You can’t perform that action at this time.