Karpathy Tips: Ask Your LLM to Output HTML, Then Open It in a Browser
Andrej Karpathy recommends appending an HTML formatting instruction to LLM queries for richer, browser-viewable output.
Andrej Karpathy shared a practical prompting tip on X on May 11: adding "structure your response as HTML" to the end of an LLM query, then opening the resulting file in a browser, produces output that is noticeably more readable than plain-text chat responses. He reports the approach works well and has also experimented with asking models to render output as slideshows and other structured formats.
The technique requires no additional tooling, APIs, or integrations — just a single sentence appended to an existing prompt. For developers, analysts, and knowledge workers who regularly ask LLMs to produce reports, summaries, or structured data, rendering output as HTML allows models to use headings, tables, and visual hierarchy that most chat interfaces strip away. Karpathy also gestured toward audio as another output modality worth exploring, though that part of his post was not fully captured in available signals.