TokenPad
RAG

RAG Citation Formatter

Three ways to make a model cite sources, priced differently.

Chunks: text | source | page or section

172 characters3 lines0 tokensor drop a file

Citation FormatterExact
0Token change
Token change0no change
Input tokens0what you pasted
Output tokens0what you would send
Token cost of this result
Output tokens0
As input$0.00
× 100K requests$0.00

Everything on this page runs in your browser. Nothing you paste is transmitted, because there is no server here to transmit it to.

Result
 

Which format to use

Numbered citation is the cheapest: the model emits [3] and your application resolves the index to a link. No source paths or URLs enter the prompt at all, and the saving is largest exactly where it matters, on long source paths.

Inline sources cost more and are simpler to render, since the citation is human-readable as generated. XML document blocks cost the most and keep the source machine-readable per chunk, which suits interfaces that highlight provenance.

Making citation actually happen

Formatting the context is half of it. The other half is an explicit instruction: state that every factual claim must carry a citation, and that claims not supported by the provided context must be declined rather than answered.

Without that instruction models cite inconsistently — most sentences, then not the one that mattered.

Frequently asked questions

Do models cite reliably?
Better with numbered indices than with long source strings, which they paraphrase or truncate. Reliability improves substantially when the prompt says that uncited claims are not acceptable.
How do I stop citations to sources that do not support the claim?
Validate after generation: check that each cited index exists and, where it matters, that the claim appears in that chunk. Prompting reduces the problem; verification catches what remains.

More rag tools