---
title: encode hex
categories: |
formats
version: 0.104.0
formats: |
Hex encode a binary value or a string.
usage: |
Hex encode a binary value or a string.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
# `encode hex` for [formats](/commands/categories/formats.md)
<div class='command-title'>Hex encode a binary value or a string.</div>
## Signature
```> encode hex {flags} ```
## Flags
- `--lower`: Encode to lowercase hex.
## Input/output types:
| input | output |
| ------ | ------ |
| binary | string |
| string | string |
## Examples
Encode a binary value
```nu
> 0x[C3 06] | encode hex
C306
```
Encode a string
```nu
> "hello" | encode hex
68656C6C6F
```
Output a Lowercase version of the encoding
```nu
> 0x[AD EF] | encode hex --lower
adef
```