Two codes Android already makes
Before you open anything else, check whether one of Android's own tools covers it.
A web page, from Chrome. Open the page, tap More (the three dots), then Share…, then QR Code, and follow the prompts to share or download it (Google's steps). It encodes the address exactly as it appears, tracking parameters and all, with one fixed look. The Chrome guide shows what a long address does to the code.
Your Wi-Fi, from Settings. Android 10 and later can show a QR code for a saved network. On a Pixel, open Settings, then Network & internet, then Internet; on a Samsung, Settings, then Connections, then Wi-Fi. Tap the gear next to your network, then Share or the QR icon, and confirm with your fingerprint or PIN. Menu names vary between phone makers and Android versions. Your friend scans the code off your screen and joins.
Everything else, in the browser
For any other code, use the generator at the top of this page in Chrome, Samsung Internet or Firefox. It makes codes for links, Wi-Fi you can print, WhatsApp, contact cards, email, SMS, locations, calendar events and payments, with colors, dot styles and a logo from your gallery.
Payments show why a proper generator matters. A shop's UPI QR code made here for the UPI ID shopname@okaxis holds this line:
upi://pay?pa=shopname@okaxis&pn=Shop%20Name&cu=INR
That's the payment-link format UPI apps expect: pa is the UPI ID, pn the name the payer sees, cu=INR the currency. You fill in the fields and the generator writes the line. The UPI page explains each part and when to fix an amount.
Tap Download PNG to save the code to your Downloads folder (2048px or more if you'll print it), or Copy image to paste it into WhatsApp, Messages or Gmail. In Chrome, More, then Add to Home screen keeps the generator one tap away.
Will these codes keep working
Codes from Chrome, the Wi-Fi share screen and our generator are all static: what they open is written into the pattern, so they keep working with no account behind them. Codes from some Play Store apps are dynamic and stop when the subscription does. Our guide to whether QR codes expire shows how to tell the two apart, and the guide to scanning on Android covers reading them back.