How to use the concordance tool
Search the text in the main input for a word, phrase, or regular-expression pattern. Each result appears in the Concordance Results (KWIC) table.
The table includes #, Line, Left context, Match, and Right context. Line is a numeric reference for the original text; it is not a link.
Search controls
The search updates when you change the text, search term, or controls. By default, Context (words) is 6, Whole word is enabled, and Case sensitive and Regex are disabled.
- Context (words): Choose 4, 6, 8, or 12 words. The tool reads up to 400 characters on each side, then returns the requested number of words. Context is shorter when fewer words are available.
- Case sensitive: Treat uppercase and lowercase letters as different when enabled.
- Whole word: Apply word boundaries to an ordinary literal search. The code does not apply this option when Regex is enabled.
- Regex: Treat the search entry as a JavaScript regular-expression pattern instead of a literal word or phrase.
How to find concordance lines
- Enter text in the main input, or choose or drop a file using Upload or Drop file. The selected file is read as text.
- Enter a word, phrase, or pattern in the search field.
- Set Context (words), Case sensitive, Whole word, and Regex for the search you need.
- Read the highlighted matches in Concordance Results (KWIC).
Read and export the results
The stats bar reports the number of matches and lines. Matches are highlighted in Match. Select Copy for tab-separated text containing the line, left context, match, and right context. Select CSV to download concordance-results.csv with Line, Left Context, Match, and Right Context columns.
Left context and Right context can be visually shortened with an ellipsis when a cell is wider than 260 pixels. Copy and CSV use the full stored context strings. Both controls do nothing when there are no results.
Empty searches, errors, and processing limits
- If the text or search term is empty, the table says: Paste text and enter a search term to see occurrences.
- If the term has no matches, the table says No occurrences of "[search term]" found. and the stats show zero matches.
- If Regex contains invalid syntax, the message begins with Invalid regular expression: and includes the browser's error detail.
- The search stops after more than 20,000 matches, so a very large result set may be incomplete. JavaScript regex matching returns non-overlapping matches; overlapping matches are not reported.
- Context cells can be visually truncated even though copied and downloaded context is complete.
File handling and privacy scope
Search matching, context extraction, clipboard preparation, and CSV generation run in browser-side JavaScript. This page's tool code contains no text-upload request. The implementation does not define a maximum file size, accepted file type or extension, text-encoding policy, or browser-compatibility policy.
Copy relies on navigator.clipboard.writeText. If the browser rejects the clipboard write, the tool has no visible error message or fallback.
Frequently Asked Questions (FAQs)
What is a concordance tool?
A concordance tool locates occurrences of a word or phrase in text and lists each one with the words around it. This tool presents those results as a KWIC table.
What does KWIC mean?
KWIC means Key Word In Context. Each result shows the matching text between separate Left context and Right context columns.
Is this concordance tool private?
Search matching and context extraction happen locally in your browser. This page's tool code contains no text-upload request; clipboard and CSV output are also prepared in the browser.