Convert an AWS .pem to PuTTY .ppk, and a .ppk to OpenSSH format
Step-by-step screenshots of converting an AWS EC2 key pair (.pem) to a .ppk for PuTTY and WinSCP, and a PuTTYgen .ppk to OpenSSH format for Windows ssh, VS Code and Git, using a browser-based SSH key converter. The converted keys were reloaded in PuTTYgen 0.81 and ssh-keygen to confirm they work. Also covers matching the fingerprints listed under GitHub's “SSH and GPG keys” to your local keys, finding old DSA and short RSA keys in authorized_keys, and why the RSA fingerprint in the AWS console does not match ssh-keygen.
Contents
When you create an EC2 instance on AWS, you receive the key pair as a .pem file. If you use PuTTY or WinSCP on Windows, you cannot log in until you convert it to .ppk. The reverse also happens: you may have an old .ppk key made with PuTTYgen that you now want to use with the ssh command built into Windows, VS Code’s Remote - SSH, or Git. OpenSSH cannot read .ppk, so that needs a conversion too.
Once the format problem is solved, another one often follows: you no longer know which key is registered where. GitHub’s settings page lists only the fingerprint of each registered key, not the file name. With several keys in your ~/.ssh, you cannot tell which one is safe to delete.
Both the conversion and the fingerprint lookup take nothing more than loading the key into the SSH key converter and fingerprint checker, which works entirely inside your browser and never sends the key to a server. All screenshots below are from the English version, and every key shown is a throwaway generated on the spot. The converted keys were reloaded with PuTTYgen 0.81 and ssh-keygen from OpenSSH 9.6 to confirm they work.
The same key is stored in different file formats by different software
Mathematically, an SSH key pair is defined by its type (such as RSA or Ed25519) and its numbers. The file format used to write those numbers, however, differs from one program to another.
- PEM (starts with
-----BEGIN RSA PRIVATE KEY-----): the format used by OpenSSL, and the format of the.pemkey pairs you get from AWS. OpenSSH can read it too. - OpenSSH format (
-----BEGIN OPENSSH PRIVATE KEY-----): the standard format written by current versions ofssh-keygen. Ed25519 keys are normally stored in this format. - PuTTY .ppk (starts with
PuTTY-User-Key-File-3:): the proprietary format used by PuTTY, WinSCP, FileZilla and others. PuTTY 0.75 (May 2021) introduced version 3, which changed the tamper-check calculation and the passphrase handling compared with version 2.
As long as the key inside is the same, changing the format does not change the fingerprint. That means you can verify a conversion by checking that the fingerprint is the same before and after. The tool shows the fingerprints of every key it loads.
Step 1: Turn an AWS .pem into a .ppk for PuTTY and WinSCP
Open the tool page and pick the key pair’s .pem with “Choose files” in the “Load keys” section. You can also drag the file onto the input box, or open it in a text editor and paste its contents. Here, my-ec2-key.pem was loaded, created in the same format as AWS uses (PKCS#1, RSA 2048-bit).

After loading, one key appears in the “Loaded keys” section. Its type is “RSA 2048 bits”, it is marked “Private key included”, and the loaded format is “PEM private key (PKCS#1, RSA)”. When you load a .pem, the Output format is already set to “PuTTY .ppk (version 3, PuTTY 0.75 or later)”.
An AWS .pem contains no comment (the short description attached to a key), so my-ec2-key was entered in “Comment in output”. PuTTY displays this name when it loads the key, which makes it easier to tell keys apart when you connect to several servers. Pressing “Save” downloads my-ec2-key.ppk.
Here is the result of loading the saved .ppk into PuTTYgen 0.81 and printing its fingerprint.
$ puttygen -l -E sha256 my-ec2-key.ppk
ssh-rsa 2048 SHA256:2e3AWNgqbdG7dOxm7u3VvV8uVyhU/ispJmg0TeIgGTE
The value is the same as the “Fingerprint (SHA256)” shown in the tool, and PuTTYgen read the file only after verifying the .ppk tamper-check value (Private-MAC). In PuTTY, set this file as the “Private key file for authentication” under “Connection → SSH → Auth → Credentials” (“Connection → SSH → Auth” in 0.76 and earlier), and you can log in to the EC2 instance.
PuTTY 0.74 and earlier, WinSCP before 5.19 and FileZilla before 3.57.0 cannot read version 3 and show an error such as “PuTTY key format too new”. If you cannot update the old software, choose “PuTTY .ppk (version 2, old PuTTY and WinSCP)” as the output format. The saved my-ec2-key_ppk2.ppk was also loaded in PuTTYgen and showed the same fingerprint.
Step 2: Convert a .ppk for Windows ssh, VS Code and Git
The reverse conversion works on the same screen. After removing the previous key with “Clear”, an Ed25519 key made with PuTTYgen, work-pc.ppk, was loaded. When you load a .ppk, the output format is already set to “OpenSSH private key (ssh, VS Code, Git)”.
“Save” downloads a file named work-pc with no extension. OpenSSH private keys are conventionally stored without an extension, like id_ed25519, and the tool follows that convention. Reading the saved file with ssh-keygen extracted the public key and fingerprint.
$ ssh-keygen -lf work-pc
256 SHA256:AQ9pv1seVyzdx0bCcEGwe+V/I5CbKgD/+YlAYx9WQ+w alex@work-pc (ED25519)
On Windows, put the file in C:\Users\<your user name>\.ssh\ and either pass it with ssh -i or set it as IdentityFile in .ssh\config. VS Code’s Remote - SSH and the ssh in Git for Windows both read the OpenSSH configuration, so the same file works for both. If you move it to macOS or Linux, run chmod 600 work-pc so that only you can read it. If the permissions are too open, ssh warns “UNPROTECTED PRIVATE KEY FILE!” and refuses to use the key.
Step 3: Use fingerprints to find which key is registered on GitHub
GitHub’s “Settings → SSH and GPG keys” lists each registered key with its title and a fingerprint starting with SHA256:. If you want to delete a key you no longer use but cannot tell which local file it corresponds to, compare fingerprints.
Load all the keys in your ~/.ssh at once. “Choose files” accepts multiple files, including files without an extension such as id_ed25519. Here, four files were loaded: three public keys (id_ed25519.pub, id_ecdsa.pub and work-pc.pub) and the private key id_ed25519. The fingerprint copied from GitHub’s page was pasted into “Fingerprint to match (optional)”.

“Matches the fingerprint: #2” appeared at the top of the results, and the box for the second key, id_ecdsa.pub, turned green with a “Match” label. So the key still registered on GitHub was the ECDSA key with the comment old-ci.
You can paste the value from GitHub’s page as is. Values without the SHA256: prefix, or with a trailing =, are treated as the same fingerprint. Older formats are also supported: values starting with MD5: and colon-separated hexadecimal fingerprints. The same steps work for fingerprints in ssh -v logs and in the warning shown when a server’s host key changes (REMOTE HOST IDENTIFICATION HAS CHANGED). Paste the contents of known_hosts and each line is checked.
If you load private and public keys together, matching pairs are linked on a “Same key” row. In this case, the first key, id_ed25519.pub, and the fourth, the private key id_ed25519, showed “Same key as #4” and “Same key as #1”. This also tells you which public key goes with a private key whose .pub file you have deleted or whose file name you have changed.
The AWS console fingerprint does not match because it is calculated differently
AWS is where fingerprint matching most often confuses people. For RSA keys, the fingerprint shown under “Key pairs” in the EC2 console is calculated differently from ssh-keygen and GitHub. According to the AWS documentation, for RSA keys created by AWS it is the SHA-1 of the private key converted to PKCS#8 (DER), and for imported RSA keys it is the MD5 of the public key (DER). ssh-keygen and GitHub use the SHA-256 of the public key in SSH format.
Running the commands from the AWS documentation on my-ec2-key.pem from Step 1 gave these values.
$ openssl pkcs8 -in my-ec2-key.pem -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c
SHA1(stdin)= b3:55:f9:ce:95:52:e7:c3:de:6e:f4:e4:0a:3f:95:b1:a7:90:b3:2e
$ openssl rsa -in my-ec2-key.pem -pubout -outform DER | openssl md5 -c
MD5(stdin)= 0c:2d:53:94:23:93:74:5a:00:5e:38:73:f7:dc:f0:a4
Neither matches the tool’s SHA256:2e3AWNgq... or MD5:59:0f:74:5b.... Even the two MD5 values differ, because the public key bytes being hashed are in a different shape (DER versus SSH format). So if you enter the RSA fingerprint from the AWS console in the tool’s match field, it will not match (an SHA-1 value is reported as an unrecognized format). To check an AWS fingerprint against a local .pem, use the openssl commands above. Only for ED25519 keys does AWS also use the SHA-256 of the public key, so apart from the trailing =, the value is the same as ssh-keygen and this tool.
Paste authorized_keys to find old keys and keys with restrictions
To check whose keys are allowed to log in on the server side, paste the contents of ~/.ssh/authorized_keys into the input box as is. Each line is loaded as one key, with its type, length, fingerprint and comment listed. Here, four lines were pasted: an Ed25519 key, a 2048-bit RSA key restricted by source address, a 1024-bit RSA key and a DSA key.
If a line starts with an option such as from="203.0.113.0/24", it is shown on an “Options” row. That way you will not miss keys restricted to certain source IP addresses, or keys locked to a single command with command=.
Lines 3 and 4 received warnings in red. The 1024-bit RSA key is flagged as shorter than 2048 bits and below current recommendations, and the DSA key as disabled by default since OpenSSH 7.0, with support removed entirely in OpenSSH 10.0. For the DSA key, only fingerprint checks are available, and no conversion section is shown.
Keys like these are often left in place for an old NAS or backup device. The problem tends to surface when the server’s OpenSSH is updated and that device suddenly cannot log in, so it is worth taking stock before the update. When deciding whether to remove a key, use its comment and fingerprint to find out who owns it and which device uses it.
If you need a replacement, generate an Ed25519 key on the same screen
The tool can also generate the new key that replaces an old one. In the “Generate a new key” section, leave “Key type” as “Ed25519 (recommended)”, enter a name that tells you which device the key belongs to in “Comment”, such as alex@laptop-2026, and press “Generate key”. The key is generated with the browser’s Web Crypto API and added to the results as a “Generated key”.
A private key format is selected at first, so save the private key with “Save”, then switch the output format to “OpenSSH public key (.pub, authorized_keys, GitHub)” and save the public key as well. Copy the one-line public key with “Copy” and paste it into GitHub’s “New SSH key” or the server’s authorized_keys. The generated private key was also loaded into ssh-keygen to confirm that the public key could be extracted. For old devices that cannot use Ed25519, choose “RSA 3072-bit”.
If OpenSSH is already installed where you work, ssh-keygen -t ed25519 is the quickest way to create a key. This tool is worth using when you need a .ppk at the same time as the key, or when you want to create a key on a device where you cannot use the command line.
Certificates and private keys run into the same kind of format wall. How to split a Windows .pfx into PEM files for Nginx is covered in “Using a Windows PFX with Nginx”, and you can inspect the contents of a server certificate with the SSL certificate and CSR decoder.