Text line endings normalize
text-line-endings-normalize · version 1.0.0 · Text · free, no key needed
Normalize all line endings in a text to a specific format (LF, CRLF, or CR).
Use when you need to: text line endings normalize · normalize line endings · convert crlf to lf.
Decide before calling
Read the versioned contract and the supported scope below. Reuse text-line-endings-normalize@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use text-line-endings-normalize@1.0.0 for text line endings normalize. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- text line endings normalize
- normalize line endings
- convert crlf to lf
- convert lf to crlf
Not supported
- unicode normalization
- whitespace trimming
- read files
Behavior
- Replaces all line ending sequences (CRLF, CR, LF) that do not match the requested format.
- format can be "lf", "crlf", or "cr". Default is "lf".
- Returns the normalized text and the number of line endings that were modified.
Input
text(string, required): max length 1048576format(one of "lf", "crlf", "cr", optional)
Output
text(string, required): max length 2097152replacements(integer, required): min 0
Limits
- max text bytes: 1048576
- max output bytes: 2097152
Example
Request input:
{
"text": "Line 1\r\nLine 2\rLine 3\n",
"format": "lf"
}
Response:
{
"result": {
"text": "Line 1\nLine 2\nLine 3\n",
"replacements": 2
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "text-line-endings-normalize",
"version": "1.0.0",
"input": {
"text": "Line 1\r\nLine 2\rLine 3\n",
"format": "lf"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/text-line-endings-normalize/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"Line 1\r\nLine 2\rLine 3\n","format":"lf"}'
The machine-readable contract is at /v1/tools/text-line-endings-normalize/versions/1.0.0.
CLI
node cli.mjs run text-line-endings-normalize 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Text slugify: Create a deterministic ASCII or Unicode slug using an explicit, documented normalization profile.
- Citation record normalize: Normalize one CSL 1.0.2 citation record: NFC, whitespace, empty values, DOI wrapper, page dashes, dates; lists changes.
- Text run length encode: Run-length encode Unicode text into canonical count:HEX; records and return the encoded string.
- Text tabs to spaces: Convert tab characters to spaces.
- Citation anchor check: Check a quote anchor (exact text plus prefix/suffix) matches exactly one place in a supplied source version.
- Text apply unified patch: Apply a one-file unified patch to text at original line addresses with exact hunk matches.