YouTube has a Restricted Mode you can enable in the settings for the mobile app, or within the web browser used to watch the videos. Restricted Mode attempts to scan and filter out the adult-oriented content posted to the site so young viewers do not see it, but YouTube admits the setting is not 100 percent accurate.

To evaluate videos, the site uses information from posted clips, like a video’s description, title, community-guideline reviews, metadata embedded in the file and any age restrictions added by the person who posted it. YouTube has been known to tinker with the filter settings to keep them current, although doing so last spring inadvertently banned nonexplicit L.G.B.T. content — a move that the company, which issued an apology, reversed. (As a general civility bonus, however, Restricted Mode also blocks any comments posted to videos.)

Schools, libraries and other public computers may have Restricted Mode already enabled, but you can activate the setting on the computers and devices you use. To turn on the setting in a web browser, select your YouTube account icon in the top-right corner of the screen, and when the menu opens, select Restricted Mode and flip the button to the On position. Older versions of the YouTube web interface have a Restricted Mode button at the bottom of each page. If you use multiple browsers on your computer, you need to turn on Restricted Mode in each one.

YouTube’s Restricted Mode can be activated in the settings for the Android, shown here, or iOS mobile apps, and within a web browser.

To activate the content filter in the YouTube app for Android, make sure you are signed into your YouTube or Google account, and tap your profile picture or the menu icon in the upper-right corner of the screen. From the menu, choose Settings, then General and then Restricted Mode.

To do the same in the iOS app, tap your profile icon in the corner, select Settings and then tap Restricted Mode filtering. Select the Strict option to start screening out inappropriate clips.

If you are trying to keep children from stumbling into inappropriate video content, setting them up with the YouTube Kids site instead is another option; apps are available for Android and iOS devices, along with a parental guide for using the service. Depending on your hardware and software, you may also be able to use parental controls built into the operating system to restrict access to apps and sites you would rather the children not see; third-party programs to police online activity are also available.