# Text strip BOM

`text-strip-bom` · version 1.0.0 · Text · free, no key needed

Remove one leading U+FEFF byte-order mark from a Unicode string.

**Use when you need to: text strip bom · strip leading bom · remove leading feff.**

## Supported

- text strip bom
- strip leading bom
- remove leading feff

## Not supported

- strip every U+FEFF
- decode files
- guess encoding
- utf-16 transcoding
- unicode normalization
- read files

## Behavior

- text is a Unicode string of at most 250 KiB UTF-8.
- If the first code point is U+FEFF, exactly one leading BOM is removed and stripped is true.
- U+FEFF after the first code point is left unchanged.
- If the first code point is not U+FEFF, including the empty string, the text is returned unchanged and stripped is false.
- No Unicode normalization, transcoding, or whitespace trimming is performed.

## Input

- `text` (string, required): max length 256000

## Output

- `text` (string, required): max length 256000
- `stripped` (boolean, required)

## Limits

- max input bytes: 256000
- max output bytes: 256000

## Example

Request input:

```json
{
  "text": "﻿Hello"
}
```

Response:

```json
{
  "result": {
    "text": "Hello",
    "stripped": true
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "text-strip-bom",
  "version": "1.0.0",
  "input": {
    "text": "﻿Hello"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/text-strip-bom/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"﻿Hello"}'
```

The machine-readable contract is at [/v1/tools/text-strip-bom/versions/1.0.0](/v1/tools/text-strip-bom/versions/1.0.0).

### CLI

```sh
node cli.mjs run text-strip-bom 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Text lines multiset subtract](/tools/text-lines-multiset-subtract): Multiset subtract b from a: remaining counts, first-seen order from a.
- [Text trailing whitespace trim](/tools/text-trailing-whitespace-trim): Remove trailing whitespace from each line in a text.
- [Text apply unified patch](/tools/text-apply-unified-patch): Apply a one-file unified patch to text at original line addresses with exact hunk matches.
- [Text conflict parse](/tools/text-conflict-parse): Parse merge or diff3 conflict-marker text into ordered text and conflict parts.
- [Text conflict render](/tools/text-conflict-render): Render text and conflict parts as merge or diff3 conflict-marker text.
- [Text control characters find](/tools/text-control-characters-find): Find non-whitespace control characters in a text string.
