A QR code holds your text itself, encoded with enough redundancy that a camera can still read it through a scratch, a fold or a coffee stain.
Four things go in here. A link is the common case and the shortest: fewer characters mean a sparser, more forgiving code. Text is the same thing without a protocol, useful for a serial number or a note. Wi-Fi encodes the network name and password in a format phones understand as a connection offer rather than a string. A contact card carries a vCard, so one scan fills in a name, a phone and an email.
The code below is live: it already encodes the default values, and it is rendered on the server, so it is there before any JavaScript runs and it scans exactly as it looks. Change a field and it rebuilds as you type.
Two settings deserve a word. Error correction buys damage tolerance with space — more redundancy, bigger symbol. A logo covers the middle of the code, which is only survivable because the maximum correction level can reconstruct what the logo hides; that is why choosing one locks the level.
The file holds exactly what the screen shows — same colours, same logo, same correction level, one image built once. SVG stays sharp at any size and is what a printer wants. PNG is what a chat window wants.