{"id":13618409,"url":"https://github.com/multiformats/multibase","last_synced_at":"2026-01-30T16:01:27.480Z","repository":{"id":41067004,"uuid":"66260181","full_name":"multiformats/multibase","owner":"multiformats","description":"Self identifying base encodings","archived":false,"fork":false,"pushed_at":"2025-05-11T14:46:47.000Z","size":118,"stargazers_count":313,"open_issues_count":29,"forks_count":77,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-06-02T20:01:58.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiformats.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-22T09:48:40.000Z","updated_at":"2025-05-31T19:49:16.000Z","dependencies_parsed_at":"2023-01-18T10:17:36.339Z","dependency_job_id":"a8ca9b85-f50f-4678-a9dd-2695169cd11a","html_url":"https://github.com/multiformats/multibase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/multiformats/multibase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fmultibase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fmultibase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fmultibase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fmultibase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/multibase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fmultibase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:02:00.812Z","updated_at":"2026-01-30T16:01:27.474Z","avatar_url":"https://github.com/multiformats.png","language":null,"funding_links":[],"categories":["others","Others"],"sub_categories":[],"readme":"# Multibase\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)\n[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n\u003e Self-identifying base encodings\n\nMultibase is a protocol for disambiguating the \"base encoding\" used to express binary data in text formats (e.g., base32, base36, base64, base58, etc.) from the expression alone.\n\nWhen text is encoded as bytes, we can usually use a one-size-fits-all encoding (UTF-8) because we're always encoding to the same set of 256 bytes (+/- the NUL byte).\nWhen that doesn't work, usually for historical or performance reasons, we can usually infer the encoding from the context.\n\nHowever, when bytes are encoded as text (using a base encoding), the choice of base encoding (and alphabet, and other factors) is often restricted by the context.\nWorse, these restrictions can change based on where the data appears in the text. \nIn some cases, we can only use `[a-z0-9]`; in others, we can use a larger set of characters but need a compact encoding. \nThis has lead to a large set of \"base encodings\", almost one for every use-case.\nUnlike the case of encoding text to bytes, it is impractical to standardize widely around a single base encoding because there is no optimal encoding for all cases.\n\nAs data travels beyond its context, it becomes quite hard to ascertain *which* base encoding of the many possible ones were used; that's where multibase comes in. \nWhere the data has been prefixed before leaving its context behind, it answers the question:\n\n\u003e Given binary data `d` encoded into text `s`, what base `b` was used to encode it?\n\nTo answer this question, a single code point is prepended to `s` at time of encoding, which signals in that new context which `b` can be used to reconstruct `d`.\n\n## Table of Contents\n\n- [Format](#format)\n  - [Multibase Table](#multibase-table)\n- [Specifications](#specifications)\n- [Status](#status)\n  - [Reserved Terms](#reserved-terms)\n- [Multibase By Example](#multibase-by-example)\n- [FAQ](#faq)\n- [Implementations:](#implementations)\n- [Disclaimers](#disclaimers)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Format\n\nThe Format is:\n\n```\n\u003cbase-encoding-code-point\u003e\u003cbase-encoded-data\u003e\n```\n\nWhere `\u003cbase-encoding-code-point\u003e` is a code representing an entry in the multibase table.\n\n### Multibase Table\n\nThe current multibase table is [here](multibase.csv):\n\n```\nUnicode,    character,  encoding,           description,                                                    status\nU+0000,     NUL,        none,               (No base encoding),                                             reserved\nU+0030,     0,          base2,              Binary (01010101),                                              experimental\nU+0031,     1,          none,               (No base encoding)                                              reserved\nU+0037,     7,          base8,              Octal,                                                          draft\nU+0039,     9,          base10,             Decimal,                                                        draft\nU+0066,     f,          base16,             Hexadecimal (lowercase),                                        final\nU+0046,     F,          base16upper,        Hexadecimal (uppercase),                                        final\nU+0076,     v,          base32hex,          RFC4648 case-insensitive - no padding - highest char,           experimental\nU+0056,     V,          base32hexupper,     RFC4648 case-insensitive - no padding - highest char,           experimental\nU+0074,     t,          base32hexpad,       RFC4648 case-insensitive - with padding,                        experimental\nU+0054,     T,          base32hexpadupper,  RFC4648 case-insensitive - with padding,                        experimental\nU+0062,     b,          base32,             RFC4648 case-insensitive - no padding,                          final\nU+0042,     B,          base32upper,        RFC4648 case-insensitive - no padding,                          final\nU+0063,     c,          base32pad,          RFC4648 case-insensitive - with padding,                        draft\nU+0043,     C,          base32padupper,     RFC4648 case-insensitive - with padding,                        draft\nU+0068,     h,          base32z,            z-base-32 (used by Tahoe-LAFS),                                 draft\nU+006b,     k,          base36,             Base36 [0-9a-z] case-insensitive - no padding,                  draft\nU+004b,     K,          base36upper,        Base36 [0-9a-z] case-insensitive - no padding,                  draft\nU+0052,     R,          base45,             Base45 RFC9285,                                                 draft\nU+007a,     z,          base58btc,          Base58 Bitcoin,                                                 final\nU+005a,     Z,          base58flickr,       Base58 Flicker,                                                 experimental\nU+006d,     m,          base64,             RFC4648 no padding,                                             final\nU+004d,     M,          base64pad,          RFC4648 with padding - MIME encoding,                           experimental\nU+0075,     u,          base64url,          RFC4648 no padding,                                             final\nU+0055,     U,          base64urlpad,       RFC4648 with padding,                                           final\nU+0070,     p,          proquint,           Proquint (https://arxiv.org/html/0901.4016),                    experimental\nU+0051,     Q,          none,               (no base encoding)                                              reserved\nU+002F,     /,          none,               (no base encoding)                                              reserved\nU+1F680,    🚀,         base256emoji,       base256 with custom alphabet using variable-sized-codepoints,   experimental\n```\n\n**NOTE:** Multibase-prefixes are encoding agnostic. \"z\" is \"z\", not 0x7a (\"z\" encoded as ASCII/UTF-8). In UTF-32, for example, that same \"z\" would be `[0x7a, 0x00, 0x00, 0x00]` not `[0x7a]`, so detecting and dropping an initial byte of `0x7a` would not suffice to confirm the rest was `base58btc`-encoded bytes; `[0x7a, 0x00, 0x00, 0x00]` would instead be the UTF-32 bytes that correspond to the `z` codepoint for that entry, and the entire byte array would need to be detected and dropped. Also note the difference between `0x00` (codepoint 0 or 0x00) and `0` (codepoint 48 or 0x30).\n\n## Specifications\n\nBelow is a list of specs for the underlying base encodings:\n\n- `base2` [Base2 RFC](rfcs/Base2.md)\n- `base8` [Base8 RFC](rfcs/Base8.md), similar to [rfc4648](https://datatracker.ietf.org/doc/html/rfc4648.html)\n- `base10` [Base10 RFC](rfcs/Base10.md)\n- `base36` [Base36 RFC](rfcs/Base36.md)\n- `base16*` [RFC4648](https://datatracker.ietf.org/doc/html/rfc4648.html)\n- `base32*` (Except for `base32z`) [rfc4648](https://datatracker.ietf.org/doc/html/rfc4648.html)\n- `base32z` [Human-oriented base32 spec](https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt)\n- `base45` [RFC9285](https://datatracker.ietf.org/doc/html/rfc9285.html)\n- `base64*` [RFC4648](https://datatracker.ietf.org/doc/html/rfc4648.html)\n- `base58btc` https://datatracker.ietf.org/doc/html/draft-msporny-base58-02\n- `base58flickr` https://datatracker.ietf.org/doc/html/draft-msporny-base58-02, but using a different alphabet\n- `proquint` [Proquint RFC](rfcs/Proquint.md), which is the [original spec](https://arxiv.org/html/0901.4016) with an added prefix for legibility\n- `base256emoji` [Base256Emoji RFC](rfcs/Base256Emoji.md)\n\n\n## Status\n\nEach multibase encoding has a status:\n\n* reserved - for functional reasons or to avoid collisions with other multi-* registries, this registry cannot accept registrations at this code-point and implementing one unregistered is discouraged for interoperability reasons\n* experimental - these encodings have been proposed but are not widely implemented and may be removed.\n* draft - these encodings are mature and widely implemented but may not be implemented by all implementations.\n* final - these encodings should be implemented by all implementations and are widely used.\n* deprecated - this entry will likely be removed and reassigned in the future and it will not likely become a `final` registration\n\n### Reserved Terms\n\nThe following codes are _reserved_ and cannot be registered in the `multibase` table. Note that all three of the Unicode entries, expressed as the [unsigned varint] expression of that Unicode code-point in UTF-8, correspond to widely-used entries in the [multiformats registry group] that could create confusions for some legacy systems handling both binary and multibased structures from other multiformats. While technically the multibase registry is not part of the [multiformats registry group], these reservations minimize risk of confusion when composing multiple multiformats in one data system.\n\n* `NUL` (n/a) - Legacy data may be found with null-byte-prefixed binary structures mixed in among multibase-encoded ones in arrays of data, although support for this is no longer mandated by conformant implementations.\n* `/` (U+002F) - Separator used by [multiaddr].\n* `1` (U+0031) - Base58-encoded identity multihashes used by libp2p peer IDs.\n* `Q` (U+0051) - Base58-encoded sha2-256 multihashes used by libp2p/ipfs for peer IDs and CIDv0.\n\n## Multibase By Example\n\nConsider the following encodings of the same binary string:\n\n```\n4D756C74696261736520697320617765736F6D6521205C6F2F # base16 (hex)\nJV2WY5DJMJQXGZJANFZSAYLXMVZW63LFEEQFY3ZP           # base32\n3IY8QKL64VUGCX009XWUHKF6GBBTS3TVRXFRA5R            # base36\nTZ9:VDNEDHECDZC+ED944A4FVQEF$DK84%UB21             # base45\nYAjKoNbau5KiqmHPmSxYCvn66dA1vLmwbt                 # base58\nTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw==               # base64\n```\n\nAnd consider the same encodings with their multibase prefix\n\n```\nF4D756C74696261736520697320617765736F6D6521205C6F2F # base16 F\nBJV2WY5DJMJQXGZJANFZSAYLXMVZW63LFEEQFY3ZP           # base32 B\nK3IY8QKL64VUGCX009XWUHKF6GBBTS3TVRXFRA5R            # base36 K\nRTZ9:VDNEDHECDZC+ED944A4FVQEF$DK84%UB21             # base45 R\nzYAjKoNbau5KiqmHPmSxYCvn66dA1vLmwbt                 # base58 z\nMTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw==               # base64 M\n```\n\nThe base prefixes used are: `F, B, K, R, z, M`.\n\n\n## FAQ\n\n\u003e Is this a real problem?\n\nYes. If i give you `\"1214314321432165\"` is that decimal? or hex? or something else? See also:\n- https://en.wikipedia.org/wiki/8-bit_clean\n- https://en.wikipedia.org/wiki/MIME#Content-Transfer-Encoding\n- http://stackoverflow.com/questions/8571501/how-to-check-whether-the-string-is-base64-encoded-or-not\n\n\u003e Why the strange selection of codes / characters?\n\nThe code values are selected such that they are included in the alphabets of the base they represent. \nFor example, `f` is the base code for `base16 (hex)`, because `f` is in hex's 16 character alphabet.\nNote that most of the alphabets used can be encoded in UTF-8, and most but not all can be encoded in ASCII.\nWe have yet not found a case needing something else.\n\n\u003e Don't we have to agree on a table of base encodings?\n\nYes, but we already have to agree on base encodings, so this is not hard.\nThe table even leaves some room for custom encodings and is intended to work both in contexts where the encodings are known or agreed on and open-world or brownfield contexts where these may vary.\n\n## Implementations:\n\n- [go-multibase](https://github.com/multiformats/go-multibase)\n- [js-multibase](https://github.com/multiformats/js-multibase)\n- C#\n  - [cs-multibase](https://github.com/tabrath/cs-multibase)\n  - [SimpleBase](https://github.com/ssg/SimpleBase)\n- [rust-multibase](https://github.com/multiformats/rust-multibase)\n- Java\n  - [java-multibase](https://github.com/multiformats/java-multibase)\n  - [copper-multibase](https://github.com/filip26/copper-multibase)\n- [py-multibase](https://github.com/multiformats/py-multibase)\n- [haskell-multibase](https://github.com/multiformats/haskell-multibase)\n- [net-ipfs-core](https://github.com/richardschneider/net-ipfs-core)\n- [elixir-multibase](https://github.com/nocursor/ex-multibase)\n- [scala-multibase](https://github.com/fluency03/scala-multibase)\n- [cpp-multibase](https://github.com/cpp-ipfs/cpp-multibase)\n- [ruby-multibase](https://github.com/sleeplessbyte/ruby-multibase)\n- [dart-multibase](https://github.com/heacare/dart-multibase)\n- [yoclib-multibase-php](https://github.com/yocto/yoclib-multibase-php)\n- `multibase` sub-module of Python module [multiformats](https://github.com/hashberg-io/multiformats)\n- Kotlin\n  - [kotlin-multibase](https://github.com/changjiashuai/kotlin-multibase)\n  - `multibase` part of Kotlin project [multiformat](https://github.com/erwin-kok/multiformat)\n- [zig-multibase](https://github.com/zen-eth/multiformats-zig)\n- `Multibase` part of the [MultiformatsKit](https://github.com/ATProtoKit/MultiformatsKit) Swift package\n- [Add yours here!](https://github.com/multiformats/multibase/edit/master/README.md)\n\n\n## Disclaimers\n\nWarning: **obviously multibase changes the first character depending on the encoding**. \nDo not expect the value to be exactly the same. \nRemove the multibase prefix before using the value.\n\n## Contribute\n\nContributions welcome. \nPlease check out [the issues](https://github.com/multiformats/multibase/issues) and reading the [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for the greater multiformats project before opening your first issue, as the workflow and the relation of multibase to the greater project both benefit from this context.\nmore information on how we work, and about contributing in general.\n\nIf you'd like to switch a project over to multibase, whether by creating a new multibase implementation or building on one of those listed above, please file an issue in this repository using the \"Interested in implementing\" issue template.\nIf would also like to reserve a prefix for compatibility, please file a separate issue in this repository using the \"New Registration\" issue template.\n\n## License\n\nThis repository is only for documents. \nAll of these are licensed under the [CC-BY-SA 3.0](https://ipfs.io/ipfs/QmVreNvKsQmQZ83T86cWSjPu2vR3yZHGPm5jnxFuunEB9u) license © 2016 Protocol Labs Inc.\nAny code is under a [MIT](LICENSE) © 2016 Protocol Labs Inc.\n\n[multiaddr]: https://github.com/multiformats/multiaddr\n[multiformats registry group]: https://github.com/multiformats/multicodec/blob/master/table.csv\n[unsigned varint]: https://github.com/multiformats/unsigned-varint\n[code point]: https://infra.spec.whatwg.org/#code-points\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fmultibase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fmultibase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fmultibase/lists"}