Base32 Encoder & Decoder

Decode Base32

About Base32

What is Base32?

RFC 4648 Base32 groups bytes into five-bit values represented by A-Z and 2-7, then pads the final eight-character block with =. This decoder ignores whitespace and letter case but validates block length, padding, and unused padding bits.

Why use Base32?

Use Base32 for human-entered tokens or systems that prefer a case-insensitive alphanumeric alphabet. It expands data by about 60%, supplies neither secrecy nor error detection, and is not compatible with Crockford Base32 or Base32hex alphabets.

Base32 in JavaScript

// npm install hi-base32
const base32 = require('hi-base32');

const encoded = base32.encode('Hello');
console.log(encoded);
// Output: JBSWY3DP

const decoded = Buffer.from(base32.decode.asBytes('JBSWY3DP')).toString('utf8');
console.log(decoded);
// Output: Hello
				

Base32 in Go

package main

import (
	"encoding/base32"
	"fmt"
)

func main() {
	encoded := base32.StdEncoding.EncodeToString([]byte("Hello"))
	fmt.Println(encoded)
	// Output: JBSWY3DP

	decoded, _ := base32.StdEncoding.DecodeString("JBSWY3DP")
	fmt.Println(string(decoded))
	// Output: Hello
}
				

Base32 in PHP

<?php
// composer require paragonie/constant_time_encoding
require 'vendor/autoload.php';

use ParagonIE\ConstantTime\Encoding;

$encoded = Encoding::base32EncodeUpper("Hello");
echo $encoded . "\n";
// Output: JBSWY3DP

$decoded = Encoding::base32DecodeUpper("JBSWY3DP");
echo $decoded . "\n";
// Output: Hello