# bb26

> Bijective base-26 utility library

Latest version **5.2.1** (published 2026-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install bb26
pnpm add bb26
yarn add bb26
bun add bb26
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.2.1 |
| Published | 2026-06-20 |
| First published | 2019-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Patrik Csak |
| Maintainers | ptrkcsk |
| Keywords | base 26, bijective base 26, spreadsheet, spreadsheet column, spreadsheet column letters, license plate serials |

## Links

- npm: https://www.npmjs.com/package/bb26
- Repository: https://github.com/patrik-csak/BB26
- Homepage: https://github.com/patrik-csak/BB26#readme
- Issues: https://github.com/patrik-csak/BB26/issues
- npm.io page: https://npm.io/package/bb26

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 5.2.1 (latest) — 2026-06-20
- 5.2.0 — 2026-05-01
- 5.1.1 — 2026-04-20
- 5.1.0 — 2026-04-20
- 5.1.0-1 — 2026-04-20
- 5.1.0-0 — 2026-04-20
- 5.0.2 — 2026-01-21
- 5.0.1 — 2026-01-17
- 5.0.0 — 2025-07-26
- 4.0.0 — 2023-05-24
- 3.0.2 — 2023-04-25
- 3.0.1 — 2023-04-05
- 3.0.0 — 2023-03-29
- 2.2.1 — 2022-11-23
- 2.2.0 — 2021-12-25
- … 12 more at https://npm.io/package/bb26/versions

## README

# BB26

BB26 is a JavaScript library for working with [bijective base-26](https://en.wikipedia.org/wiki/Bijective_numeration#The_bijective_base-26_system) (BB26) numbers.

## What is bijective base-26 numeration?

You’re probably familiar with BB26 numeration. It’s used for spreadsheet columns, license plate serials, and (probably?) more.

Here’s an example of decimal (base-10) numbers (the numbers you use every day to count things) compared to their corresponding BB26 numbers:

```text
Decimal: | 1 | 2 | 3 | … | 24 | 25 | 26 | 27 | 28 | 29 | …
   BB26: | A | B | C | … |  X |  Y |  Z | AA | AB | AC | …
```

## Install

```shell
npm install bb26
```

## API

- [`increment`](#increment)
- [`random`](#random)
- [`range`](#range)
- [`toBb26`](#tobb26)
- [`toDecimal`](#todecimal)

### `increment()`

Increments a bijective base-26 string by one numeral.

#### Signature

```typescript
function increment(string: string): string;
```

#### Examples

```javascript
import {increment} from 'bb26';

increment('A'); // 'B'
increment('Z'); // 'AA'
increment('AA'); // 'AB'
```

### `random()`

Produces a random string between the inclusive `lower` and `upper` bounds. If only one argument is provided, a string between `'A'` and the given string is returned.

#### Signature

```typescript
function random(upper: string): string;
function random(lower: string, upper: string): string;
```

#### Examples

```javascript
import {random} from 'bb26';

random('AAA'); // 'NE'
random('AAA', 'AAAA'); // 'KXZ'
```

### `range()`

Creates an array of bijective base-26 numerals progressing from `start` up to, but not including, `end`. If `end` is not specified, it's set to `start` with `start` then set to `'A'`.

#### Signature

```typescript
function range(end: string): string[];
function range(start: string, end: string): string[];
```

#### Examples

```javascript
import {range} from 'bb26';

range('B'); // ['A']
range('C'); // ['A', 'B']
range('B', 'C'); // ['B']
range('B', 'D'); // ['B', 'C']
range('Z', 'AC'); // ['Z', 'AA', 'AB']
```

### `toBb26()`

Converts a decimal number to a bijective base-26 string.

#### Signature

```typescript
function toBb26(number: number): string;
```

#### Examples

```javascript
import {toBb26} from 'bb26';

toBb26(1); // 'A'
toBb26(2); // 'B'
toBb26(26); // 'Z'
toBb26(27); // 'AA'
toBb26(28); // 'AB'
```

### `toDecimal()`

Converts a bijective base-26 string to a decimal number.

#### Signature

```typescript
function toDecimal(string: string): number;
```

#### Examples

```javascript
import {toDecimal} from 'bb26';

toDecimal('A'); // 1
toDecimal('B'); // 2
toDecimal('Z'); // 26
toDecimal('AA'); // 27
toDecimal('AB'); // 28
```

---
_Source: https://npm.io/package/bb26 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
