Skip to content
ImageLabeling

COCO annotation tool with clean COCO JSON import and export

A COCO annotation tool should read the COCO JSON you already have and write a file your training code loads on the first try. ImageLabeling imports existing COCO labels, lets your team review and extend them with AI pre-labels, and exports every frozen dataset version as valid COCO JSON with boxes, segmentation and keypoints.

Engineer comparing printed dataset annotation files spread on a desk next to a laptop

How COCO JSON is organized

A COCO file is one JSON document with three main lists. The export writes all three, with IDs that stay stable inside a dataset version.

  • images: one entry per image, with id, file_name, width and height
  • annotations: one entry per object, with id, image_id, category_id, bbox, area, iscrowd and, when present, segmentation and keypoints
  • categories: one entry per class, with id, name and, for skeletons, the keypoint names and connections

A trimmed example of one image with one boxed object:

{
  "images": [
    { "id": 1, "file_name": "shelf_0001.jpg", "width": 1280, "height": 960 }
  ],
  "annotations": [
    { "id": 17, "image_id": 1, "category_id": 3,
      "bbox": [412.0, 230.5, 96.0, 188.0],
      "area": 18048.0, "iscrowd": 0 }
  ],
  "categories": [
    { "id": 3, "name": "bottle", "supercategory": "product" }
  ]
}

Bounding boxes in COCO

The bbox field holds x and y of the top left corner, then width and height, all in pixels. This differs from YOLO, which uses normalized center coordinates, and from Pascal VOC, which uses corner coordinates. Our coco vs yolo format post compares all three.

The segmentation field

Pallet rack in a logistics warehouse with cardboard boxes, a forklift in the aisle and a worker in a high visibility vest and hard hat

Polygons from the editor export as lists of x and y pairs in the segmentation field, one list per polygon part. Masks painted on Team and above export in the same field, together with the area and enclosing box of each object. Read how masks are drawn on the image segmentation tool page.

The keypoints field

For skeletons, each annotation holds a flat list of x, y and visibility values in the order defined in the category, plus num_keypoints. The category lists the keypoint names and the skeleton edges. Visibility follows the COCO convention of 0, 1 and 2. The keypoint annotation tool page explains how labelers set those flags.

Import existing labels into the COCO annotation tool

City crossing with cars, a cyclist, pedestrians on a zebra crossing and a traffic light

Upload your images, then import the COCO JSON that belongs to them. Categories become classes in your label schema, and annotations appear in the editor as editable objects. From there your team reviews old labels, fixes errors and adds the classes that were never labeled. AI pre-labels fill gaps for new classes and new images.

The same import path accepts YOLO txt, Pascal VOC XML and CSV, which lets you consolidate datasets that were labeled in different tools.

  • Images are matched by file_name
  • Categories map to classes, and you can rename or merge them before import
  • Imported labels can go straight into review, so nothing is trusted blindly

Export COCO JSON from a frozen version

Exports come from dataset versions. You freeze a version, choose train, validation and test split ratios, and export one COCO file per split. Version comparison shows labels added, changed and removed between two versions, so you always know what changed between two training runs.

Need YOLO instead? See the YOLO labeling tool page. On Team and above, the API triggers exports from your pipeline, as shown on the computer vision annotation tool page.

  • COCO JSON, YOLO txt with data.yaml, Pascal VOC XML and CSV from the same version
  • Re-exports do not count toward the monthly AI image quota
  • Starter keeps 3 dataset versions, every other plan keeps as many as you need

COCO on every plan

Apples and a few oranges rolling on a stainless steel conveyor belt in a packing plant, a gloved hand sorting

COCO import and export are part of every plan, from Starter at 49 USD per month or 24 USD per month billed yearly. Masks start on Team and keypoint skeletons on Business, which decides which COCO fields your exports fill. Compare limits on the pricing page.

FAQ

Does the COCO export include segmentation masks?

Yes, when your plan includes masks. Polygons and masks go into the segmentation field, with area and enclosing box for each object.

Can I import a COCO file from another tool?

Yes. Upload the images, import the COCO JSON, and the categories and annotations appear as editable labels. Images are matched by file name.

Is the iscrowd flag supported?

Every exported annotation carries iscrowd. Labels from the editor are single instances, so they export with iscrowd set to 0.

Can I export only one split?

Yes. Each split of a frozen version exports as its own file, so you can download train, validation or test on its own.

Turn your images into a COCO dataset

Start with one image in the free demo, then create your workspace and export your first COCO version.