The best video format for YouTube is MP4 with the H.264 video codec and AAC-LC audio codec, because YouTube's transcoding pipeline, recommended upload settings, and player are all optimized around that combination and it consistently produces the smallest uploads at the best visual quality for full-HD and 4K playback. YouTube additionally accepts many other containers including MOV, AVI, MKV, WebM, FLV, WMV, 3GPP, DNxHR, ProRes, CineForm, and HEVC, so uploading a WebM produced locally is also legal — the file will be transcoded on the server regardless of the source container. The question most uploaders actually need answered is which pixel dimensions to produce, since YouTube re-encodes whatever you send and may add black bars or downscale to its 16:9 player if the source aspect ratio does not match. The safe, broadly compatible target is 1920 × 1080 (1080p) in 16:9, with 1280 × 720 (720p), 2560 × 1440 (1440p), and 3840 × 2160 (4K UHD) as the other supported rungs on that ladder. If your source clip is the wrong size for that target, resizing it locally before upload is the fastest way to control the result.

YouTube's accepted video containers and codecs
YouTube publishes a list of accepted upload formats in its help center. Beyond MP4, the platform documents support for MOV, MPEG-1, MPEG-2, MPEG-4, MPG, MPL, M2V, M4V, WMV, AVI, FLV, 3GPP, WebM, DNxHR, ProRes, CineForm, HEVC (h265), and MKV containers. Within those containers the platform accepts a wide spread of video codecs and treats each uploaded file as a transcode input: whatever you send is decoded server-side, then re-encoded into multiple playback renditions. The practical implication is that the choice of source container rarely affects visual quality, but the choice of codec, bit depth, and pixel dimensions does, because heavy compression artefacts, overshooting 4K, or odd pixel counts can all survive into the final stream.
For audio, YouTube's documented recommendation is AAC-LC in stereo or 5.1, with the official upload preset listing 48 kHz sample rate as the target. WAV, FLAC, and Opus are also accepted, but YouTube re-encodes everything to AAC for playback, so uploading a high-quality source track gives the transcoder more to work with.
YouTube's recommended upload settings
YouTube's recommended upload preset is the clearest statement of the best video format for YouTube, and the same ladder is what most creators target when they export from a non-linear editor:
| Resolution | Container | Video codec | Audio codec | Notes |
|---|---|---|---|---|
| 2160p (3840 × 2160) | MP4 | H.264 | AAC-LC | 4K UHD ceiling, requires high bitrate |
| 1440p (2560 × 1440) | MP4 | H.264 | AAC-LC | QHD, useful for high-motion footage |
| 1080p (1920 × 1080) | MP4 | H.264 | AAC-LC | Default HD target |
| 720p (1280 × 720) | MP4 | H.264 | AAC-LC | Default SD-HD target |
| 480p (854 × 480) | MP4 | H.264 | AAC-LC | Standard definition |
Resolutions above 4K are accepted but downscale on the server, so the practical ceiling is 3840 × 2160. The platform also publishes recommended bitrate ranges per resolution, but those depend on frame rate and content type, so they are best treated as guidance rather than hard rules. The two constants that matter for almost every upload are: encode in 16:9 to match the player aspect ratio, and stay at or below 3840 × 2160.
How to resize a video for YouTube locally
Resizing locally is the right step when your source clip has the wrong pixel dimensions for YouTube's recommended ladder. A browser-based option that does not upload your footage is Video Resizer, which decodes, resizes, records, and downloads entirely inside the current tab. The exact steps are:
- Choose one supported local video — MP4, WebM, MOV, M4V, or Ogg — and wait for the browser to finish loading its metadata before changing any other controls.
- Enter the maximum width and height you want. For a 1080p YouTube upload, that is 1920 wide and 1080 tall. Then choose Fit to preserve the source aspect ratio inside that box, or Stretch to force the exact width and height.
- Select Resize video, leave the tab open for the duration of the real-time encode (the run takes about as long as the clip itself because the tool captures frames at up to 30 fps), and download the resulting WebM when the button appears.
The tool is bounded: each requested dimension must be a whole number from 2 to 1920 pixels, the source can be up to 500 MiB and five minutes long, and the source must be at most 4096 pixels per side and no greater than 3840 × 2160 in area. Output dimensions are made even, since common browser video encoders are more reliable with codec-safe even pixel sizes. Because decode, canvas resizing, recording, and download generation all happen in the local browser tab, the source file never reaches a server.
Fit versus Stretch and aspect ratio
YouTube's player is a 16:9 frame, so matching the source aspect ratio to 16:9 is the most common goal. Fit mode treats the dimensions you enter as a bounding box: it scales the source by the smaller of the two ratios (width-scale or height-scale), preserves the source ratio, and never crops. If your clip is already 16:9 and you enter 1920 × 1080, Fit produces 1920 × 1080. If your clip is 9:16 portrait, Fit produces the largest 9:16 rectangle that fits inside the 1920 × 1080 box and leaves the rest of the canvas unused, so portrait creators should rotate the source to 16:9 first and then resize.
Stretch mode uses the width and height independently. It will produce exactly the dimensions you requested, which is useful when you intentionally want a non-standard size, but it will distort the picture if the source ratio does not match. Both modes round odd dimensions down to even numbers because the underlying browser encoders in the canvas-to-stream pipeline (documented on MDN's HTMLCanvasElement.captureStream reference) and the MediaRecorder API are more reliable with even pixel sizes. MediaRecorder picks a supported VP9 or VP8 WebM configuration, and any browser-exposed audio tracks are added during the capture.
When to use a desktop encoder instead
The browser tool covers the common case, but several situations call for a dedicated desktop encoder:
- The source exceeds 500 MiB or five minutes in length.
- You need the final file to be MP4, not WebM — for example, to keep the file compatible with a non-YouTube workflow that rejects WebM.
- You need frame-accurate trimming before upload, which is a job better suited to a tool that can cut on exact timestamps such as the local YouTube trimming guide.
- The source has multiple audio tracks or subtitle tracks that must survive into the upload.
- You want professional mastering controls such as exact bitrate, color-managed grading, or hardware-accelerated H.264 encoding.
For clips under five minutes where the only problem is the wrong pixel size, Video Resizer is one local path: pick the YouTube target dimensions, choose Fit for a clean 16:9 upload, wait for the encode to finish, and download the WebM directly into your upload folder. This is a real-time re-encode rather than a metadata-only dimension change, so quality, bitrate, frame timing, audio layout, color metadata, and file size can all differ from the source — but the pixel size you asked for is guaranteed. The generated WebM receives a finite duration through the shared Matroska duration writer, so the playback length matches the encoded clip rather than the browser's default stream length.