---
title: "removebom Formula Function: Remove a Byte Order Mark in Nodinite Search Fields"
description: "The removebom Formula function removes a leading byte order mark (BOM) from the message body, a context property, or another function's result, so values and nested functions start with the real content."
---

# :fa-function: Formula - removebom

The `removebom` [Formula][] function returns the content without a leading byte order mark (BOM).

![Compare the length of decoded base64 text with and without removebom in the Test Expression tab, animated walkthrough (7.12)][hero]  
*Animated walkthrough: on the base64 body from [Example 1](#example-1-remove-the-bom-from-decoded-base64-content), `length(base64decode(body))` returns `12`, the 11 characters of `test åäöÅÄÖ` plus the invisible BOM, and `length(removebom(base64decode(body)))` returns `11`.*  

## :fa-code: Syntax

```text
removebom(content)
```

### Parameters

|Parameter|Required|Description|
|---|---|---|
|`content`|Yes|The text to clean: [body][], [context][], or the result of another function.|

### Returns

The content with a leading BOM removed from each value. [Content][] without a BOM is returned unchanged.

## :fa-list-ol: Examples

A UTF-8 BOM is the bytes `EF BB BF` at the start of a file or message (see [With BOM vs without BOM][]). It's invisible in most editors, but it is still a character, and it can sit at the start of base64 text that you decode with [base64decode][].

### Example 1: Remove the BOM from decoded base64 content

#### Input

The [Log API][] takes the message body base64-encoded. To log a body that is itself the base64 text `77u/dGVzdCDDpcOkw7bDhcOEw5Y=`, you send it encoded once more:

```text
Nzd1L2RHVnpkQ0REcGNPa3c3YkRoY09FdzVZPQ==
```

The logged body, shown on the **Message Body** tab and read as UTF-8, is:

```text
77u/dGVzdCDDpcOkw7bDhcOEw5Y=
```

`base64decode(body)` turns this into the bytes `EF BB BF` (a UTF-8 BOM) followed by `test åäöÅÄÖ`. The BOM stays in the result as an invisible first character.

#### Formula and Result

Compare the length of the decoded text with and without `removebom`, using [length][]:

| Formula | Result | Screenshot |
| --- | --- | --- |
| `length(base64decode(body))` | `12` | ![Test Expression tab: length(base64decode(body)) returns 12 for the decoded text with a BOM (7.12)][ex1a] |
| `length(removebom(base64decode(body)))` | `11` | ![Test Expression tab: length(removebom(base64decode(body))) returns 11 once the BOM is removed (7.12)][ex1b] |

*`test åäöÅÄÖ` is 11 characters; the extra character in the first result is the BOM, which `removebom` strips.*  

The same applies to any content that holds base64 text starting with a BOM, for example a JSON property value read with [jsonPath][]: `removebom(base64decode(jsonPath('Payload', body)))`.

## :fa-circle-info: Notes

* Only a BOM at the start of each value is removed. To change characters elsewhere in the text, use [replace][] or [replaceregex][].
* A message body read with a *without BOM* [Character Encoding][], such as **UTF-8 (without BOM)**, already has its BOM removed before the formula runs; `removebom` matters for BOMs inside decoded or embedded content.

## :fa-hand-point-right: Next Steps

* :fa-magnifying-glass-plus: [Add or manage Search Field][]  
* :fa-flask: [Test Your Expression][]  
* :fa-hard-drive: [Add or manage Log View][]  

## :fa-link-horizontal: Related Topics

* :fa-link: [concat][]  
* :fa-right-left: [replace][]  
* :fa-code: [replaceregex][]  
* :fa-scissors: [substring][]  
* :fa-function: [Formula][]  
* :fa-scroll: [Formula language rules][]  
* :fa-puzzle-piece: [Search Field Expressions][]  
* :fa-language: [Character Encoding][]  

[Add or manage Log View]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Add%20or%20Manage%20Log%20View.md
[Add or manage Search Field]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md
[base64decode]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Convert/base64decode.md
[body]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/body.md
[Character Encoding]:{ndr}/Core%20Services/Log%20Event/Features/Character%20Encoding.md
[concat]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Alter/concat.md
[Content]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#fa-scroll-formula-language-rules
[Context]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/context.md
[ex1a]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Alter/removebom_example1_length12.png
[ex1b]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Alter/removebom_example1_length11.png
[Formula]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md
[Formula language rules]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#fa-scroll-formula-language-rules
[hero]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Alter/Formula_RemoveBom.gif
[jsonPath]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/jsonPath.md
[length]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Math/length.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[replace]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Alter/replace.md
[replaceregex]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Alter/replaceregex.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[substring]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Alter/substring.md
[Test Your Expression]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md#test-your-expression
[With BOM vs without BOM]:{ndr}/Core%20Services/Log%20Event/Features/Character%20Encoding.md#fa-code-compare-with-bom-vs-without-bom