A README is the front door of a project. It is the page a visitor lands on when they find your repository, and most of them decide within a screenful whether the project is worth their time. A README that answers four questions quickly, what is this, how do I install it, how do I use it, what does a real run look like, turns that visitor into a user. One that rambles, or renders as a wall of broken formatting, quietly sends them away.

This guide walks through writing a README in Markdown section by section, then drafting and checking the whole file in the Markdown Editor with Preview on Ovatly before it goes into the repo. You write in the left pane and watch the rendered page build up on the right, which is exactly the view your repository visitors will get.

Contents

  • Quick answer
  • What a README has to do
  • Section 1: the title and what it is
  • Section 2: installation
  • Section 3: usage
  • Section 4: a worked example
  • How to draft and preview it, step by step
  • Worked example: a complete small README
  • Limitations
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Write the README in this order: the project name as the top heading, one short paragraph saying what the project is and who it is for, an Installation section with the exact commands in a code block, a Usage section with the basic commands or steps, and an Example section showing one real input and its output. Draft it in the Markdown Editor with Preview, check that every heading, list, link and code block renders cleanly, then paste the source into the repository as the README file. Keep the source in the repo: the editor saves nothing.

What a README has to do

A README has one job: take a stranger from finding the project to running it, with no outside help. Everything in the file serves that path. Background, history and design essays can live in other documents; the README stays practical. That focus is also what keeps it short enough to finish, which matters, because an unfinished README usually means the install section was written and the example never was.

Order matters as much as content. Readers scan from the top, so the file follows the order of their questions: first identity, then setup, then use, then proof.

Section 1: the title and what it is

The first line is the project name as a level-one heading, # Project Name, with the space after the hash mark. Under it, one short paragraph: what the project does, in plain words, and who it is for. Two or three sentences is plenty. If a reader cannot tell from this paragraph whether the project solves their problem, no later section will rescue the file.

Section 2: installation

Give the exact commands, in a fenced code block, in the order the reader runs them. Do not describe the commands in prose and make the reader reconstruct them. If installation differs by platform, use a short subheading per platform rather than one tangled paragraph. State any requirement, such as a minimum version of the runtime, before the commands, so a reader whose setup cannot work finds out in ten seconds instead of after an error.

Section 3: usage

Show the smallest useful run: the basic command or the basic steps, with the options a beginner actually needs. Resist documenting every flag here. Cover the common case completely and link to fuller documentation if it exists. Short lists work well in this section, one line per action, and each line should start with the thing the reader does.

Section 4: a worked example

An example is where the README earns trust. Show one real input and the output it produces, both in code blocks, with a sentence before them saying what the example demonstrates. Readers copy examples and adapt them, so use realistic values rather than placeholder words. The editor itself follows this pattern: writing # Title and a line Hello **world** produces the HTML <h1>Title</h1> and <p>Hello <strong>world</strong></p>, which you can see in the preview and copy from the export box. Your README example should give the reader that same input-to-output clarity for your project.

How to draft and preview it, step by step

  1. Open the Markdown Editor with Preview and write the title heading and the opening paragraph in the left pane.
  2. Add the Installation, Usage and Example sections in order, using fenced code blocks for every command, input and output.
  3. Watch the preview on the right as you type. Check that headings show as headings, lists break out of their paragraphs, and no code block swallows the text below it.
  4. Read the preview top to bottom as a stranger would: could you install and run the project from this page alone?
  5. Copy the finished source Markdown and paste it into your repository as the README file. If you also need the rendered markup, copy the sanitized HTML export from the box below the editor.

Worked example: a complete small README

Here is a README for a small invented utility, small enough to read in one pass and complete enough to use:

# csv-squeeze

csv-squeeze removes duplicate rows from CSV files. It is for anyone who
receives spreadsheet exports with repeated records and wants a clean file
without opening a full spreadsheet application.

## Installation

Requires Python 3.10 or later.

```
pip install csv-squeeze
```

## Usage

- Pass the input file as the first argument.
- Pass the output file as the second argument.
- Add `--keep-first` to keep the first copy of each duplicate row.

## Example

Input file `orders.csv` contains a repeated order line. Running:

```
csv-squeeze orders.csv clean.csv
```

produces `clean.csv` with each order appearing once, and prints
`Removed 14 duplicate rows`.

Drafted in the editor, the preview shows the heading hierarchy, the requirement line, both code blocks and the usage list exactly as a repository page will show them, so any formatting slip is caught before the file is committed.

Limitations

The editor renders standard Markdown, CommonMark-style, via the marked library. Repository hosts add their own extensions and quirks on top of that, so a file that previews cleanly here can still render slightly differently in your repo; treat the preview as a close check, not a pixel guarantee. The preview and export are sanitized with DOMPurify, so active content pasted as raw HTML is stripped by design. And nothing is saved: the editor holds your draft only while the page is open, which is why the repository, not the tool, is the README's home.

Common mistakes

The most common README mistake is starting with history instead of identity: three paragraphs about why the project was built, and the reader still does not know what it does. Second is describing commands in prose instead of showing them in a code block the reader can copy. Third is an example with placeholder values that could never run. Fourth is formatting that was never previewed: a heading missing its space, a fence left unclosed, a link written backwards. All four are cheap to fix at draft time and expensive to leave, because every visitor meets them.

FAQs

What sections does a README need? Four core sections cover most projects: what it is (a short description under the title), installation, usage, and an example. Add licence or contributing notes only when they apply to your project.

How long should a README be? Long enough to get a stranger from finding the project to running it. For a small tool that can be one screen: a paragraph of description, a short install block, a few usage lines and one example. Length is not the goal, a working first run is.

Why preview a README before committing it? Because the repository renders the file, and rendering mistakes, a missing space after a heading mark, an unclosed code fence, a reversed link, are invisible in the raw source. A live preview shows the page your visitors will actually see.

Can I write raw HTML in a README? In the editor, the preview is sanitized with DOMPurify, so scripts, iframes and inline event handlers are stripped by design and the HTML export matches the preview. Plain formatting tags pass through. Repository hosts apply their own rules, so keep the README to standard Markdown where you can.

Does the editor keep a copy of my README? No. Nothing is saved: refresh the page and the text is gone. Paste the finished source into your repository, which is where the README belongs.

Conclusion

A good README is four answers in order: what it is, how to install it, how to use it, and one example that proves it works. Draft it with the preview open, and the page your visitors see is the page you already checked. If the preview ever shows you hashes, pipes or brackets that should have been invisible, the fixes are quick: Common Markdown Mistakes and How to Fix Them covers the five that break most files. More guides for developers are collected under Developer Tools guides.