# @nodecfdi/base-converter

> Librería que convierte un número entre bases arbitrarias

Latest version **3.0.1** (published 2026-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nodecfdi/base-converter
pnpm add @nodecfdi/base-converter
yarn add @nodecfdi/base-converter
bun add @nodecfdi/base-converter
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2026-11-18 |
| First published | 2022-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.13.0 \|\| ^24 \|\| ^26 |
| Dependencies | 0 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Fernando Isidro <luffynando@gmail.com> |
| Maintainers | luffynando, celli33 |
| Keywords | base, converter, decimal, hexadecimal, binary |

## Links

- npm: https://www.npmjs.com/package/@nodecfdi/base-converter
- Repository: https://github.com/nodecfdi/base-converter
- Issues: https://github.com/nodecfdi/base-converter/issues
- npm.io page: https://npm.io/package/@nodecfdi/base-converter

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2026-11-18
- 3.0.0 — 2025-09-04
- 2.0.0 — 2025-06-24
- 1.0.7 — 2024-10-04
- 1.0.6 — 2024-08-08
- 1.0.5 — 2024-07-13
- 1.0.4 — 2024-07-01
- 1.0.3 — 2024-04-27
- 1.0.2 — 2024-04-03
- 1.0.1 — 2024-02-28
- 1.0.0 — 2023-07-08
- 0.1.3 — 2023-03-30
- 0.1.2 — 2023-02-23
- 0.1.1 — 2023-01-10
- 0.1.0 — 2022-07-06

## README

# `@nodecfdi/base-converter`

[![Source Code][badge-source]][source]
[![Npm Node Version Support][badge-node-version]][node-version]
[![Discord][badge-discord]][discord]
[![Latest Version][badge-release]][release]
[![Software License][badge-license]][license]
[![Build Status][badge-build]][build]
[![Reliability][badge-reliability]][reliability]
[![Maintainability][badge-maintainability]][maintainability]
[![Code Coverage][badge-coverage]][coverage]
[![Violations][badge-violations]][violations]
[![Total Downloads][badge-downloads]][downloads]

> TS utility for converting an input from any base to another base
> the min base this library accepts is 2.

:us: The documentation of this project is in spanish as this is the natural language for intended audience.

:mexico: La documentación del proyecto está en español porque ese es el lenguaje principal de los usuarios.

## Inicio rápido

Instala el paquete con tu gestor de dependencias preferido:

```bash
# pnpm
pnpm add @nodecfdi/base-converter

# npm
npm install @nodecfdi/base-converter

# yarn
yarn add @nodecfdi/base-converter

# bun
bun add @nodecfdi/base-converter
```

Convierte números de cualquier longitud entre distintas bases (por ejemplo, de hexadecimal a decimal o binario):

```ts
import { BaseConverter } from '@nodecfdi/base-converter';

const converter = BaseConverter.createBase36();

// Hexadecimal (base 16) a Binario (base 2)
console.log(converter.convert('ffff', 16, 2)); // "1111111111111111"

// Número largo en Hexadecimal (base 16) a Decimal (base 10) sin pérdida de precisión
const input = '3330303031303030303030333030303233373038';
console.log(converter.convert(input, 16, 10)); // "292233162870206001759766198425879490508935868472"
```

## Documentación

La documentación está disponible en el sitio web [NodeCfdi](https://nodecfdi.com/packages/base-converter/getting-started)

## Soporte

Puedes obtener soporte abriendo un ticket en Github.

## Compatibilidad

Esta librería se mantendrá compatible con al menos la versión con
[soporte activo de Node](https://nodejs.org/es/about/releases/) más reciente.

También utilizamos [Versionado Semántico 2.0.0](https://semver.org/lang/es/) por lo que puedes usar esta librería sin temor a romper tu aplicación.

## Contribuciones

Las contribuciones con bienvenidas. Por favor lee [CONTRIBUTING][] para más detalles y recuerda revisar el archivo [CHANGELOG][].

## Copyright y Licencia

The `@nodecfdi/base-converter` library is copyright © [NodeCfdi](https://github.com/nodecfdi) and licensed for use under the MIT License (MIT). Please see [LICENSE][] for more information.

[contributing]: https://github.com/nodecfdi/.github/blob/main/docs/CONTRIBUTING.md
[changelog]: https://github.com/nodecfdi/base-converter/blob/main/CHANGELOG.md
[source]: https://github.com/nodecfdi/base-converter
[node-version]: https://www.npmjs.com/package/@nodecfdi/base-converter
[discord]: https://discord.gg/AsqX8fkW2k
[release]: https://www.npmjs.com/package/@nodecfdi/base-converter
[license]: https://github.com/nodecfdi/base-converter/blob/main/LICENSE.md
[build]: https://github.com/nodecfdi/base-converter/actions/workflows/build.yml?query=branch:main
[reliability]: https://sonarcloud.io/component_measures?id=nodecfdi_base-converter&metric=Reliability
[maintainability]: https://sonarcloud.io/component_measures?id=nodecfdi_base-converter&metric=Maintainability
[coverage]: https://sonarcloud.io/component_measures?id=nodecfdi_base-converter&metric=Coverage
[violations]: https://sonarcloud.io/project/issues?id=nodecfdi_base-converter&resolved=false
[downloads]: https://www.npmjs.com/package/@nodecfdi/base-converter
[badge-source]: https://img.shields.io/badge/source-nodecfdi/base--converter-blue.svg?logo=github
[badge-node-version]: https://img.shields.io/node/v/@nodecfdi/base-converter.svg?logo=nodedotjs
[badge-discord]: https://img.shields.io/discord/459860554090283019?logo=discord
[badge-release]: https://img.shields.io/npm/v/@nodecfdi/base-converter.svg?logo=npm
[badge-license]: https://img.shields.io/github/license/nodecfdi/base-converter.svg?logo=open-source-initiative
[badge-build]: https://img.shields.io/github/actions/workflow/status/nodecfdi/base-converter/build.yml?branch=main
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=nodecfdi_base-converter&metric=reliability_rating
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=nodecfdi_base-converter&metric=sqale_rating
[badge-coverage]: https://img.shields.io/sonar/coverage/nodecfdi_base-converter/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-violations]: https://img.shields.io/sonar/violations/nodecfdi_base-converter/main?format=long&logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-downloads]: https://img.shields.io/npm/dm/@nodecfdi/base-converter.svg?logo=npm

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