SharePoint Online has never had a single switch that forces every file in a library to open in read only mode for everyone. That surprises a lot of people who assume it must exist somewhere in library settings. It does not, and the workarounds people reach for instead each come with a real tradeoff worth understanding before you pick one.
The reliable option: permissions, not settings
If you actually need certain people to be unable to edit a file, the correct tool is SharePoint's permission levels, not a display setting. Give those users or that group the Read permission level instead of Edit or Contribute, either at the library level or on the specific file if it needs to differ from the rest of the library. This is enforced by SharePoint itself, works the same whether someone opens the file in the browser or a desktop app, and cannot be bypassed by changing a client side setting. If the goal is genuine protection rather than a soft nudge, this is the only method that actually delivers it.
Softer options, if full permission changes are not practical
- Preview. Anyone can select a file and choose Preview from the command bar to view it in the browser without opening it for editing. This requires the person to remember to choose Preview instead of just clicking the file name, so it depends on user behaviour rather than enforcement.
- Require Check Out. Turning on required check out in the library's versioning settings means a file opens read only in the browser by default, and a user has to deliberately check it out before they can edit it. This does add real friction to editing, which is useful in some workflows and annoying in others, so it is worth testing with your team before rolling it out broadly.
Pick based on intent
If the goal is "people should not be able to change this," use permissions. If the goal is "people should default to viewing rather than editing, but can still edit when they mean to," Require Check Out is the better fit. Preview alone is the weakest of the three since it relies entirely on the user choosing it.
If your SharePoint permission structure has grown messy enough that you are not sure who can actually edit what anymore, that is worth a proper cleanup rather than another workaround layered on top. Our Microsoft 365 team can help you sort it out. Get in touch if that sounds like where you are at.