RFC 4648-compliant Base16 encodings for ByteStrings

Version on this page:
LTS Haskell 22.29:
Stackage Nightly 2024-07-19:
Latest on Hackage:

See all snapshots base16-bytestring appears in

BSD-3-Clause licensed by Bryan O'Sullivan
This version can be pinned in stack with:base16-bytestring-,2541

Module documentation for

Fast base16 support Hackage version Stackage version Build Status

Please refer to the package description on Hackage for more information.

This package provides a Haskell library for working with base16-encoded data quickly and efficiently, using the ByteString type.

Get involved!

Please report bugs via the GitHub issue tracker.

Master Git repository:

  • git clone git://


This library is written by Bryan O’Sullivan.

It is currently maintained by Emily Pillmore, Herbert Valerio Riedel and Mikhail Glushenkov.


  • Support sized primitive types in GHC 9.2 (#16 - thanks Bodigrim!)

  • Backwards-compatible support for bytestring ^>= 0.11 (#15)

  • Merged omnibus PR doing a variety of things in (#10):
    • Improves performance by 3-4x for encode, 4-5x for decode.
    • The decode signature returning the tuple and actually returns an error message with offset. The signature will now be ByteString -> Either String ByteString.
    • Actually tests using the test vectors defined in the RFC, and uses property tests to ensure invariants hold.
    • Adds lenient decoders to the API
    • Adds -XTrustworthy annotations to the relevant exposed modules
    • Rewrites the haddocks to be more up to date and fancy-styled.
    • Adds benchmarks to the .cabal file so they can be run at toplevel, and make them better.
    • Bumps the Cabal version to 1.12

Because of the breadth of this change, we are calling this a new epoch for the base16-bytestring library. Hence, the version

  • Fix some bugs in lazy decoding (#8).

  • Changelog not recorded up to this version.