Needle-in-a-Haystack Test Text Generator
Create reproducible long-context tests: a haystack of neutral sentences with your "needle" inserted at the position you choose.
Use the tool
Why this tool exists
Set the haystack length in words, the needle sentence, its depth as a percentage from the start, a question and a seed. The filler is generated from small word lists with a seeded generator, so the same settings always give the same text. The output ends with the question, the expected answer and the sentence position of the needle.
Run the same needle at several depths and lengths to see where recall degrades. Real-world long-context tasks are harder than finding one distinctive sentence, so treat results as a lower bound on difficulty.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Set the length and needle depth.
- Edit the needle and question.
- Copy the text into your model and ask the question.
- Compare answers across depths and lengths.
Frequently asked questions
What is a needle-in-a-haystack test?
A test that hides a fact in a long document and checks whether the model can retrieve it.
Why a seed?
So the same document can be regenerated for repeatable comparisons.
How many tokens is the text?
About 1.3 tokens per word for English; use the tokenizer tools for exact counts.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.