base64: A modern Base64 library

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]
Versions [RSS] 0.0.1.0, 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.1.0, 0.3.1.1, 0.4.0, 0.4.1, 0.4.2, 0.4.2.1, 0.4.2.2, 0.4.2.3, 0.4.2.4, 1.0, 1.0.1, 2.0 (info)
Change log CHANGELOG.md
Dependencies base (>=4.18 && <4.23), bytestring (>=0.11 && <0.13), deepseq (>=1.4.4.0 && <1.6), text (>=2.0 && <2.3), text-short (>=0.1 && <0.2) [details]
Tested with ghc ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.4 || ==9.14.1
License BSD-3-Clause
Copyright (c) 2019-2026 Emily Pillmore
Author Emily Pillmore
Maintainer Emily Pillmore <emilypi@cohomolo.gy>
Uploaded by topos at 2026-10-13T21:40:49Z
Category Data
Home page https://github.com/emilypi/base64
Bug tracker https://github.com/emilypi/base64/issues
Source repo head: git clone https://github.com/emilypi/base64.git
Distributions Arch:1.0, Fedora:1.0, LTSHaskell:1.0, Stackage:1.0
Reverse Dependencies 41 direct, 3981 indirect [details]
Downloads 21601 total (64 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-10-13 [all 1 reports]

Readme for base64-1.0.1

[back to package description]

Base64

Build Status Hackage

Base64 encoding and decodings.

For the companion optics and pattern synonyms, see base64-lens.

Summary

The following types are supported for both std, padded url-safe, and unpadded url-safe alphabets:

  • Data.ByteString
  • Data.ByteString.Lazy
  • Data.ByteString.Short
  • Data.Text
  • Data.Text.Lazy
  • Data.Text.Short

Additionally this library has

  • Better performance than base64-bytestring for encode and decode.
  • Optics for handling more complex structures with Base64 representations via the base64-lens package
  • Checks for both validity and correctness of Base64 and Base64url encodings
  • Rejects non-canonical encodings that do not roundtrip in other base64 libraries like ZE==.

The library supports GHC 9.6 through 9.14. Its dependencies are base, bytestring, deepseq, text, and text-short.