
That line renders a QR code that opens https://demo.example.com. Replace the domain with your own link. If the link has ?, &, # or spaces, percent-encode it first, so https://example.com/?ref=readme becomes https%3A%2F%2Fexample.com%2F%3Fref%3Dreadme. Left raw, everything after the first & would drop out of the code.
GitHub fetches external images through its own image proxy rather than letting each reader's browser hit our server. That suits these images, because the same URL always returns the same picture.
Point it somewhere worth scanning
A README on GitHub is already open in the reader's browser, so a code for the repo itself helps nobody there. Codes in a README pay off for things people want on their phone:
- the hosted demo or a mobile web app;
- an App Store or Google Play listing;
- a sponsor page, or a UPI or crypto payment code (
?type=crypto&crypto=<your address>); - the Discord or Matrix invite.
A code for the repo makes sense when the README travels without the browser: a slide at a talk, a printed handout, a poster at a meetup.
Make it clickable, and set the size
People reading on a laptop can't scan their own screen, so wrap the image in a link to the same place:
[](https://demo.example.com)
Plain Markdown has no syntax for image size, and an SVG with no size of its own can fill the column. GitHub and GitLab accept a small set of HTML in Markdown, including img with width and height:
<a href="https://demo.example.com">
<img src="https://qrcodesforever.com/qr.svg?url=demo.example.com"
alt="QR code for the demo" width="160" height="160">
</a>
Credit is optional. If you'd like to give it, a line such as [QR code by QR Codes Forever](https://qrcodesforever.com/) under the image is how other developers find the API.
To match a project's colors, add fg (a hex color without #) and pattern=dots: ?url=demo.example.com&fg=1d3fd6&pattern=dots. The parameter reference has the rest of the style options.
Static site generators
Hugo, Jekyll, Astro, Docusaurus and MkDocs turn Markdown images into ordinary <img> tags, so the one-line version works unchanged. Where the tool allows HTML in Markdown, the sized version works too. The link lives inside the image, not behind a redirect we control, so nothing about it can expire.