AI Datasets
Esc

    ↑↓ move↵ open/ search from any page

    Catalog / Vision

    MNIST (1998)

    70,000 handwritten digits, 28×28 grayscale, 10 classes.

    Why it matters

    The "hello world" of machine learning. A remix of NIST handwriting data, small enough to train on a laptop in seconds, it was the standard yardstick for neural networks from LeNet-5 to the first deep learning papers. Geoffrey Hinton called it "the drosophila of machine learning".

    Get the data

    # pip install -U huggingface_hub
    hf download ylecun/mnist --repo-type dataset \
      --local-dir mnist
    Year
    1998
    Creators
    Yann LeCun, Corinna Cortes, Christopher J.C. Burges
    Task
    Image classification (handwritten digits)
    Size
    70,000 images
    Splits
    train 60,000 · test 10,000
    Input
    28×28 grayscale image
    Labels
    Digit 0–9
    License
    CC BY-SA 3.0
    Paper
    Gradient-Based Learning Applied to Document Recognition

    Samples

    Showing 24 of 60 sampled rows(from 10,000 in the test split)
    Actual size
    28×28 px
    Enlarged 8×, pixelated
    this is all the model sees
    label: 8
    8
    label: 9
    9
    label: 0
    0
    label: 2
    2
    label: 1
    1
    label: 8
    8
    label: 9
    9
    label: 8
    8
    label: 3
    3
    label: 9
    9
    label: 2
    2
    label: 7
    7
    label: 4
    4
    label: 7
    7
    label: 3
    3
    label: 1
    1
    label: 3
    3
    label: 0
    0
    label: 5
    5
    label: 4
    4
    label: 8
    8
    label: 5
    5
    label: 8
    8
    label: 7
    7
    What one record actually looks like (raw JSON, row 2561)
    {
      "image": {
        "height": 28,
        "src": "samples/mnist/2561-image.jpg",
        "width": 28
      },
      "label": 8
    }

    Media fields point at a local copy; on Hugging Face they are bytes in a Parquet file.

    Sampled 2026-11-07 from ylecun/mnist at revision 77f3279

    Worth knowing

    Related datasets

    Landmark papers