Keys, Certificates & Tokens
Hex to PEM Converter
Process key or token data with Hex to PEM and explicit format settings. Enter the key material, choose the required format, then review the result.
This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.
Hex to PEM Converter: Wrap hexadecimal bytes in a PEM text block with a Base64 body and matching boundary labels. The converter checks byte pairs and the label before conversion. It does not validate the underlying key or certificate.
The result includes matching boundary labels, a Base64 body, and CRLF line breaks. Changing the label does not change or certify the decoded bytes.
- Wrap known DER bytes for a compatible application.
- Convert hexadecimal samples into Base64 text armor.
- Preserve exact bytes while changing their text representation.
Instructions
- Paste complete hexadecimal byte pairs into Input. Uppercase and lowercase Hex work; spaces, tabs, and line breaks are allowed.
- Set Header string to the required PEM label, such as CERTIFICATE or PUBLIC KEY.
- Use letters, digits, single spaces, or hyphens in the label. The converter trims outer whitespace and rejects empty labels.
- For a synthetic example, enter 3003020101. The Base64 body becomes MAMCAQE=. These bytes do not form a valid certificate or public key.
- Copy the complete block, including its matching BEGIN and END lines.
Example
Input: 3003020101
Settings: Header string PUBLIC KEY
Result: -----BEGIN PUBLIC KEY----- MAMCAQE= -----END PUBLIC KEY-----
These five synthetic bytes are not a valid public key. The tool does not check DER structure.
Limits
- The tool does not validate ASN.1, DER, certificate signatures, key strength, or ownership.
- Odd-length Hex, non-Hex characters, and empty input produce no conversion result.
- Input must not exceed 2097152 characters. The decoded payload must not exceed 1048576 bytes.
- Labels must not exceed 64 characters after trimming. Control characters, line breaks, and boundary delimiter injection are unsupported.
- The tool does not decrypt encrypted private keys or convert the structure of a key.