---
schema_version: "1"
id: d6429ee824cf559bfa244c58ee8e3951cb1307b6b8a42b869660d00d3b9ac09c
title: fromHex
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-binaries-functions-fromhex.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-binaries-functions-fromhex
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c39013077e510683a35b6a80dc5b2a2a08eb1952a9720db8c9129c82b62b3ef4
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# fromHex

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## fromHex(hexString: String): Binary

Transforms a hexadecimal string into a binary.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>hexString</code></p></td><td><p>A hexadecimal string to transform.</p></td></tr></tbody></table>

### Example

This example transforms a hexadecimal string to "Mule". To make the resulting type clear, it outputs
data in the `application/dw` format.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Binaries
output application/dw
---
{ "hexToBinary": fromHex("4D756C65") }
```

#### Output

```JSON
{
   hexToBinary: "TXVsZQ==" as Binary {base: "64"}
}
```
