Useful patterns for building HTML tools 10th December 2025 I’ve started using the term HTML tools to refer to HTML applications that I’ve been building which combine HTML, JavaScript, and CSS in a single file and use them to provide useful functionality. I have built over 150 of these in the past two years, almost all of them written by LLMs. This article presents a collection of useful patterns I’ve discovered along the way. First, some examples to show the kind of thing I’m talking about: svg-render renders SVG code to downloadable JPEGs or PNGs pypi-changelog lets you generate (and copy to clipboard) diffs between different PyPI package releases. bluesky-thread provides a nested view of a discussion thread on Bluesky. These are some of my recent favorites. I have dozens more like this that I use on a regular basis. You can explore my collection on tools.simonwillison.net—the by month view is useful for browsing the entire collection. If you want to see the code and prompts, almost all of the examples in this post include a link in their footer to “view source” on GitHub. The GitHub commits usually contain either the prompt itself or a link to the transcript used to create the tool. These are the characteristics I have found to be most productive in building tools of this nature: A single file: inline JavaScript and CSS in a single HTML file means the least hassle in hosting or distributing them, and crucially means you can copy and paste them out of an LLM response. Avoid React, or anything with a build step. The problem with React is that JSX requires a build step, which makes everything massively less convenient. I prompt “no react” and skip that whole rabbit hole entirely. Load dependencies from a CDN. The fewer dependencies the better, but if there’s a well known library that helps solve a problem I’m happy to load it from CDNjs or jsdelivr or similar. Keep them small. A few hundred lines means the maintainability of the code doesn’t matter too much: any good...
First seen: 2025-12-13 16:51
Last seen: 2025-12-13 18:52