Format (command)

Command-line utility that carries out disk formatting
title: "Format (command)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["external-dos-commands", "hard-disk-software", "msx-dos-commands", "os/2-commands", "windows-commands"] description: "Command-line utility that carries out disk formatting" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Format_(command)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Command-line utility that carries out disk formatting ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| name | format |
| screenshot | Ms-dosformat.png |
| caption | The MS-DOS command |
| programming language | MS-DOS: x86 assembly language |
| FreeDOS: C | |
| operating system | RT-11, 86-DOS, MS-DOS, PC DOS, OS/2, eComStation, ArcaOS, ISIS-II, iRMX 86, TRIPOS, AmigaDOS, Z80-RIO, OS-9, MSX-DOS, FlexOS, PC-MOS, SpartaDOS X, DR DOS, ROM-DOS, 4690 OS, FreeDOS, PTS-DOS, SISNE plus, Windows, ReactOS |
| platform | Cross-platform |
| genre | Command |
| license | MS-DOS: MIT |
| PC-MOS: GPLv3 | |
| FreeDOS: GPLv2 | |
| ReactOS: LGPL-2.0-or-later | |
| :: |
| name = format
| logo =
| screenshot = Ms-dosformat.png
| screenshot size =
| caption = The MS-DOS command
| developer =
| released =
| latest release version =
| latest release date =
| programming language = MS-DOS: x86 assembly language
FreeDOS: C
| operating system = RT-11, 86-DOS, MS-DOS, PC DOS, OS/2, eComStation, ArcaOS, ISIS-II, iRMX 86, TRIPOS, AmigaDOS, Z80-RIO, OS-9, MSX-DOS, FlexOS, PC-MOS, SpartaDOS X, DR DOS, ROM-DOS, 4690 OS, FreeDOS, PTS-DOS, SISNE plus, Windows, ReactOS
| platform = Cross-platform
| genre = Command
| license = MS-DOS: MIT
PC-MOS: GPLv3
FreeDOS: GPLv2
ReactOS: LGPL-2.0-or-later
| website =
In computing, format is a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.
Overview
The command performs the following actions by default on a floppy disk, hard disk drive, solid state (USB), or other magnetic medium (it will not perform these actions on optical media):
- clearing the FAT entries by changing them to
- clearing the FAT root directory by changing any values found to {{cite web |first1=Tim |last1=Paterson |author-link1=Tim Paterson |title=Microsoft DOS V1.1 and V2.0: /msdos/v20source/FORMAT.TXT |url=http://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/ |publisher=Computer History Museum, Microsoft |date=2013-12-19 |orig-year=1983 |access-date=2014-03-25 |archive-date=2019-08-14 |archive-url=https://web.archive.org/web/20190814021325/https://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/ |url-status=live |url=http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/ |title=Microsoft MS-DOS early source code |series=Software Gems: The Computer History Museum Historical Source Code Series |first=Len |last=Shustek |date=2014-03-24 |access-date=2014-03-29 |archive-date=2019-08-10 |archive-url=https://web.archive.org/web/20190810045508/https://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/ |url-status=live |url=http://blogs.technet.com/b/microsoft_blog/archive/2014/03/25/microsoft-makes-source-code-for-ms-dos-and-word-for-windows-available-to-public.aspx |title=Microsoft makes source code for MS-DOS and Word for Windows available to public |date=2014-03-25 |first=Roy |last=Levin |work=Official Microsoft Blog |access-date=2014-03-29 |archive-url=https://web.archive.org/web/20140328094124/http://blogs.technet.com/b/microsoft_blog/archive/2014/03/25/microsoft-makes-source-code-for-ms-dos-and-word-for-windows-available-to-public.aspx |archive-date=2014-03-28 |url-status=dead
- checking each cluster to see if it is good or bad and marking it as good or bad in the FAT
Any storage device must have its medium structured to be useful. This process is referred to as "creating a filesystem" in Unix, Linux, or BSD. Under these systems different commands are used. The commands can create many kinds of file systems, including those used by DOS, Windows, and OS/2.
Implementations
::figure[src="https://upload.wikimedia.org/wikipedia/commons/a/ac/IBM_PC_DOS_1.0_screenshot.png" caption="FORMAT.COM, among several other commands, in [[IBM PC DOS]] 1.0."]
::
::figure[src="https://upload.wikimedia.org/wikipedia/commons/2/26/CPM-86.png" caption="FORMAT.CMD in [[CP/M-86"]
::
The command is also available in Intel ISIS-II, iRMX 86, MetaComCo TRIPOS, AmigaDOS, Zilog Z80-RIO, Microware OS-9, DR FlexOS, TSL PC-MOS, SpartaDOS X, Datalight ROM-DOS, IBM/Toshiba 4690 OS, PTS-DOS, SISNE plus, and in the DEC RT-11 operating system.
Microsoft DOS and Windows
On MS-DOS, the command is available in versions 1 and later.
Optionally (by adding the /S, for "system" switch), format can also install a Volume Boot Record. With this option, Format writes bootstrap code to the first sector of the volume (and possibly elsewhere as well). Format always writes a BIOS Parameter Block to the first sector, with or without the /S option.
Another option (/Q) allows for what Microsoft calls "Quick Format". With this option the command will not perform steps 2 and 3 above. Format /Q does not alter data previously written to the media.
Typing "format" with no parameters in MS-DOS 3.2 or earlier would automatically, without prompting the user, format the current drive; however in MS-DOS 3.3 and later it would simply produce the error: "required parameter missing".
DR/Novell DOS
DR DOS 6.0 includes an implementation of the command.
FreeDOS
The FreeDOS version was developed by Brian E. Reifsnyder and is licensed under the GPL.
ReactOS
::figure[src="https://upload.wikimedia.org/wikipedia/commons/d/d3/ReactOS-0.4.13_format_command_667x514.png" caption="format}} command on [[ReactOS"] ::
The ReactOS implementation is based on a free clone developed by Mark Russinovich for Sysinternals in 1998. It is licensed under the GPL. It was adapted to ReactOS by Emanuele Aliberti in 1999 and supports FAT, FAT32, FATX, EXT2, and BtrFS filesystems.
Notes
The directory entries get filled with 0x00 since MS-DOS 1.25 and PC DOS 2.0. If the Format command line option /O is provided, the first byte of each directory entry is set to 0xE5h to create a FAT format usable by PC DOS 1.0-1.1. However, not providing /O will significantly speed up directory searches under MS-DOS 1.25 and PC DOS 2.0 and higher. Older versions of MS-DOS, PC DOS, and 86-DOS only supported the 0xE5 marker.
References
References
- {{man. 8. newfs. FreeBSD. EXAMPLE section
- "ISIS II Users Guide".
- "intel :: iRMX :: 146194-001 irmxR6Intro".
- https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf {{Webarchive. link. (2020-10-21 {{Bare URL PDF). (March 2022)
- (1988). "Quick reference". Abacus.
- "Z80-RIO OPERATING SYSTEM USER'S MANUAL".
- Paul S. Dayan. (1992). "The OS-9 Guru - 1 : The Facts". Galactic Industrial Limited.
- (1986). "FlexOS User's Guide".
- (2 January 2022). "roelandjansen/pcmos386v501".
- "SpartaDOS X 4.48 User Guide".
- "Datalight ROM-DOS User's Guide".
- "Users guide".
- (May 14, 2015). "SISNE plus - Referência Sumária".
- "RT-11 HELP FILE".
- (2003). "Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition". [[Microsoft Press]].
- "DR DOS 6.0 User Guide Optimisation and Configuration Tips".
- "ibiblio.org FreeDOS Package -- Format (FreeDOS Base)".
- (3 January 2022). "reactos/reactos".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::