---
title: Base Converter
description: Convert numbers between binary, octal, decimal, and hex.
---

# Base Converter

Convert numbers between base 2 (binary), 8 (octal), 10 (decimal), and 16 (hexadecimal).

## Commands

```bash
devv base <number> --from <base> --to <base>
```

## Examples

```bash
# Decimal to hex
devv base 255 --from 10 --to 16
# → FF

# Hex to binary
devv base FF --from 16 --to 2
# → 11111111

# Binary to decimal
devv base 11010 --from 2 --to 10
# → 26

# Octal to hex
devv base 777 --from 8 --to 16
# → 1FF
```

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `-f, --from <base>` | Input base (2, 8, 10, 16) | `10` |
| `-t, --to <base>` | Output base (2, 8, 10, 16) | `16` |
