AI Context Splitter & Redactor
Prepare long text before deliberately sharing it with an AI system. Paste text or load a UTF-8 TXT, Markdown, JSON, or CSV file, scan for configured sensitive patterns, optionally redact detected spans, split the result at paragraph or line boundaries, and download ordered Markdown chunks with a manifest that omits raw matches and the source filename.
Add text, choose the chunk size, and analyze it to create ordered context files.
How to Use the AI Context Splitter
Paste the text you intend to use or load one supported UTF-8 text file.
Choose a maximum character count for each exported chunk.
Keep redaction enabled when detected patterns should be replaced before export, or deliberately disable it when the exact original text must be retained.
Analyze the context, review the finding categories and limitations, then download the numbered chunks and manifest.
Context preparation workflow
Swipe horizontally to view the full table.
What the Tool Actually Does
The tool performs deterministic browser-side pattern scanning, optional replacement of detected spans, broad token estimation, and character-bounded text splitting.
It does not send the document to an AI model, summarize it, rewrite it, decide what is confidential, or approve it for disclosure.
The output is a preparation aid rather than a safety certification.
What the Scanner Detects
The scanner checks for a defined catalogue of recognizable text patterns. It does not use an AI model, provider API, breach database, or live credential-validation service.
High-confidence findings have a distinctive credential or private-key structure. Medium-confidence findings are more likely to overlap with ordinary text and require closer review.
Provider formats can change. A supported prefix does not prove that a token is active, and an unsupported or encoded secret can be missed.
Configured sensitive-pattern groups
The table summarizes the scanner implementation. Findings are pattern matches, not confirmation that a value is active or sensitive.
Swipe horizontally to view the full table.
Why Pattern Scanning Is Only One Review Layer
A deterministic scanner is useful for recognizable formats such as configured credentials and personal-data patterns.
It cannot understand every secret format or the business meaning of ordinary sentences.
A customer name, unreleased price, internal incident, medical detail, or legal strategy can be sensitive without matching a distinctive technical pattern.
Manual review and organizational data-classification rules remain necessary.
How to interpret scanner results
Swipe horizontally to view the full table.
Redaction Happens Before Chunking
When redaction is enabled, detected spans are replaced before the output is divided.
This prevents one detected value from being divided across two chunk files and ensures that the token estimate describes the exported text rather than the original source.
When redaction is disabled, every detected and undetected value remains in the chunks.
Redaction Is Not Complete De-Identification
Replacing direct identifiers does not necessarily prevent a person, company, project, or event from being inferred from surrounding details.
Dates, locations, job titles, rare events, combinations of attributes, and linked external information can act as quasi-identifiers.
High-risk data sharing may require formal de-identification methods, risk measurement, governance, access controls, or a protected data environment rather than simple pattern replacement.
Prompt Injection Remains in the Prepared Text
Documents, emails, web content, code comments, and retrieved records can contain instructions intended to manipulate an AI model or agent.
Sensitive-pattern redaction does not distinguish ordinary content from malicious instructions.
Treat every imported document as untrusted data, especially when the receiving AI can call tools, access accounts, write files, send messages, or perform external actions.
Use instruction and data separation, least-privilege tools, output validation, approval controls, and additional security testing in the receiving system.
How the Chunker Chooses Boundaries
Each chunk remains at or below the selected character ceiling.
The splitter first looks for a nearby paragraph break, then a line break, then other whitespace within the final portion of the available space.
When no suitable boundary exists, it uses the hard limit.
Windows line-ending pairs and supplementary Unicode code points are kept together.
The Chunks Preserve Reading Order
Numbered filenames determine the intended order.
Joining the chunk contents in filename order reproduces the prepared output exactly.
The splitter does not add headings to the source text, repeat overlap between chunks, remove whitespace, or summarize content.
Users who need overlapping retrieval chunks, semantic embeddings, or recursive document parsing need a different workflow.
Characters Are Not Tokens
AI models process tokens rather than a universal character count.
Token boundaries vary with the model, tokenizer, language, code structure, punctuation, whitespace, and unusual identifiers.
The tool estimates a broad range of approximately one token per five characters through one token per two characters.
Use the target model's tokenizer when an exact count is required.
Character limits and broad token estimates
Swipe horizontally to view the full table.
Choosing a Chunk Size
The correct size depends on the receiving model, existing conversation history, system instructions, attached tools, expected output length, and the task itself.
A model's context limit is not available exclusively to the document. Input instructions, previous messages, tool schemas, retrieved content, and generated output also consume tokens.
Smaller chunks can be easier to inspect and focus, while larger chunks preserve more surrounding context.
Supported Files and Strict UTF-8
The file loader accepts TXT, Markdown, JSON, and CSV files up to 2 MiB.
Files are decoded with fatal UTF-8 validation. Invalid byte sequences stop loading rather than being silently replaced.
The tool does not guess Windows-1252, ISO-8859, UTF-16, or another legacy encoding.
Convert from the known source encoding with a controlled process and keep the original file.
JSON and CSV Are Treated as Text
A JSON or CSV file is loaded as plain text.
The tool does not validate JSON syntax, identify CSV delimiters, preserve spreadsheet column types, or split records semantically.
A hard boundary can occur inside a long JSON value, CSV record, code block, URL, or identifier when no suitable whitespace exists before the limit.
What the ZIP Contains
The ZIP contains numbered Markdown chunks, a JSON manifest, and a README.
The manifest records character counts, chunk filenames and sizes, the selected chunk ceiling, token range, redaction mode, and aggregated finding categories.
It intentionally omits the original filename and raw detected values to avoid adding unnecessary sensitive metadata to the pack.
Downloaded context-pack files
Swipe horizontally to view the full table.
Review the Receiving AI Service
Local preparation does not control what happens after a chunk is uploaded, pasted, synchronized, or sent through an API.
Review the receiving provider's account type, data retention, training controls, regional processing, administrator access, logging, connected tools, and deletion policies.
Use the minimum necessary data for the task and avoid sharing production secrets when a synthetic or reduced example would work.
Recommended Pre-Share Review
A useful review separates technical pattern detection from authorization, data classification, prompt-injection risk, and provider controls.
The tool assists with only part of that process.
Pre-share review checklist
Swipe horizontally to view the full table.
Privacy and Local Processing
Text loading, pattern detection, redaction, splitting, token-range estimation, manifest creation, and ZIP compression run in the browser.
The implementation does not make an AI-model request or upload the source to an Olivez server.
Files are generated only after the download action is selected.
Chunk and Token-Range Rules
The exported text is split after optional redaction. Token values are broad planning estimates rather than model-specific counts.
Formula variables
- Original source text
- Text after optional detected-pattern redaction
- Exported chunk i
- Selected maximum characters per chunk
- Prepared output character count
- Lower planning estimate for tokens
- Upper planning estimate for tokens
Examples
Prepare a support log
1Input
A 40,000-character support log containing email addresses, a detected access token, stack traces, and several troubleshooting sections.
Show result
Result
Detected spans are optionally replaced, the prepared text is split into ordered chunks, and the manifest records category counts without copying the raw findings.
Customer identity and confidential incident details still require manual review.
Split a long Markdown document
2Input
72,000 characters with a 12,000-character ceiling.
Show result
Result
Several numbered Markdown chunks created near paragraph, line, or whitespace boundaries.
The exact chunk count can exceed a simple division because preferred natural boundaries may be earlier than the hard limit.
Retain original values deliberately
3Input
Redaction disabled for a controlled internal workflow.
Show result
Result
The chunks preserve detected values and the manifest records that redaction was disabled.
The exported pack should be handled with the same protection as the source.
No configured pattern found
4Input
An internal strategy document written entirely in ordinary prose.
Show result
Result
Zero findings may be returned even though the document remains confidential.
Pattern scanning does not understand business sensitivity.
Indirect prompt injection remains
5Input
A loaded document contains instructions telling an AI agent to ignore its task and send data elsewhere.
Show result
Result
The instructions remain unless they independently match a configured sensitive-data pattern.
The receiving AI system needs prompt-injection defenses and restricted tool permissions.
Reject invalid UTF-8
6Input
A legacy-encoded file is loaded as UTF-8.
Show result
Result
Loading stops before scanning or chunking.
Convert from the known source encoding while retaining the original.
Frequently Asked Questions
Does this tool send my text to an AI model?
No. The supplied implementation performs deterministic scanning, optional redaction, splitting, estimation, and ZIP generation locally in the browser.
Does no finding mean the text is safe to share?
No. It means only that no configured pattern matched.
Does redaction make a document anonymous?
No. Surrounding facts and combinations of attributes can still identify a person, organization, project, or event.
What does the scanner detect?
It checks for configured private-key blocks, bearer and JWT-style tokens, credential-bearing URLs, OpenAI, Stripe, GitHub, and AWS-style credentials, likely named secrets, email addresses, possible phone numbers, labelled birth dates, valid-format US Social Security numbers, possible payment-card details, and IP addresses.
Can the scanner miss secrets?
Yes. Unknown formats, encoded values, fragmented credentials, ordinary-language secrets, and unsupported patterns can be missed.
Can a finding be a false positive?
Yes. A value can resemble a credential or personal-data pattern without actually being sensitive.
Why is redaction enabled by default?
It reduces accidental retention of configured detected values in exported chunks, while still requiring manual review.
What happens when redaction is disabled?
The original detected values remain in the chunks and the manifest records that redaction was disabled.
Can it detect prompt injection?
It is not a prompt-injection detector. Malicious or irrelevant instructions can remain in the prepared text.
Does splitting summarize or rewrite my text?
No. The prepared text is divided without summarization, translation, reordering, or overlap.
Can a chunk be smaller than the selected size?
Yes. The splitter can end earlier at a nearby paragraph, line, or whitespace boundary.
Can a chunk exceed the selected size?
No. Every exported chunk remains at or below the selected character ceiling.
Why use characters instead of tokens?
Character splitting is deterministic and model-independent. Exact tokens require the tokenizer for the target model.
Is the token estimate exact for ChatGPT or an API model?
No. It is a broad character-based range and does not run a model-specific tokenizer.
How should I choose the chunk size?
Allow room for system instructions, conversation history, tools, your question, and expected output rather than using the model's entire context limit for source text.
Can I load JSON and CSV files?
Yes, but they are treated as raw text rather than parsed data structures.
Why must loaded files be UTF-8?
Strict decoding prevents an incorrect guess from silently replacing characters before scanning and export.
What is included in the manifest?
It includes settings, character counts, chunk filenames and sizes, token range, redaction mode, and aggregated finding categories.
Does the manifest contain detected secrets?
It intentionally omits raw detected values and records only category-level summaries.
Why does the result stop at 5,000 findings?
The scanner returns at most 5,000 non-overlapping findings. When that limit is reached, additional matching spans may remain in the source.
Does local processing mean the finished pack is private everywhere?
No. Local processing protects the preparation step only. Privacy after export depends on where the files are stored or sent.
Should I share production API keys after redacting other values?
No. Production secrets should be removed and managed through an appropriate secrets-management system rather than placed in AI context.
References
- OWASP — Secrets Management Cheat Sheet
- OWASP — LLM Prompt Injection Prevention Cheat Sheet
- OWASP — RAG Security Cheat Sheet
- OWASP — AI Agent Security Cheat Sheet
- NIST SP 800-188 — De-Identifying Government Datasets
- NIST SP 1800-39 — Data Classification Practices, Initial Public Draft
- GitHub — About Authentication and Token Formats
- OpenAI — What Are Tokens and How to Count Them?
You might also like
QR Code Generator
Create free static QR codes for URLs, Wi-Fi, vCards and more with logos, custom styling, PNG/SVG export, and no account, redirect, expiry, watermark, or scan limit.
Image Compressor
Compress JPG/JPEG, PNG, WebP, AVIF, HEIC, and HEIF locally with Target KB, per-image controls, before-and-after comparison, and ZIP downloads.
Screenshot Redaction Tool
Black out private areas of a screenshot with opaque replacement pixels and inspect the encoded PNG before downloading.
Image Resizer for Online Forms
Check and resize JPG, PNG or WebP images against online-form requirements for file size, pixels, format, aspect ratio and DPI.