# ical2json

> A simple node package to convert ical to JSON

Latest version **5.1.0** (published 2026-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install ical2json
pnpm add ical2json
yarn add ical2json
bun add ical2json
```

Provides the command `ical2json`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2026-08-17 |
| First published | 2013-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 1 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Adrian Lee |
| Maintainers | adrianlee44 |
| Keywords | ical, json, converter |

## Links

- npm: https://www.npmjs.com/package/ical2json
- Repository: https://github.com/adrianlee44/ical2json
- Homepage: https://github.com/adrianlee44/ical2json#readme
- Issues: https://github.com/adrianlee44/ical2json/issues
- npm.io page: https://npm.io/package/ical2json

## Dependencies (1)

- [commander](https://npm.io/package/commander.md) ^14.0.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 5.1.0 (latest) — 2026-08-17
- 5.0.0 — 2026-03-28
- 4.1.3 — 2026-03-28
- 4.1.2 — 2026-01-21
- 4.1.1 — 2025-11-24
- 4.1.0 — 2024-10-05
- 4.0.1 — 2024-07-13
- 4.0.0 — 2024-06-16
- 3.2.0 — 2023-11-13
- 3.1.2 — 2022-07-10
- 3.1.1 — 2022-07-02
- 3.1.0 — 2022-06-20
- 3.0.0 — 2019-12-08
- 2.0.0 — 2019-07-03
- 1.2.0 — 2017-04-28
- … 9 more at https://npm.io/package/ical2json/versions

## README

# ical2json

A simple node package to convert iCal data (.ics file) to JSON format

![Tests](https://github.com/adrianlee44/ical2json/workflows/Tests/badge.svg)
[![codecov](https://codecov.io/gh/adrianlee44/ical2json/graph/badge.svg?token=SIFGIFEB7T)](https://codecov.io/gh/adrianlee44/ical2json)

Requires Node.js ≥ 20.

## Getting started

Install globally for CLI use:

```sh
npm install -g ical2json
```

Install locally for programmatic use:

```sh
npm install ical2json
```

To convert an ics file to json:

```sh
$ ical2json ./US-Holiday.ics
```

The json output will be written to a `.json` file in the same directory:

```
./US-Holiday.json
```

To write the output to a separate directory, use the `-o` or `--output-dir` option:

```sh
$ ical2json --output-dir ~/destination/directory ./US-Holiday.ics
```

To revert a JSON file back to ical:

```sh
$ ical2json --revert ./US-Holiday.json
```

To print output to stdout instead of a file:

```sh
$ ical2json --stdout ./US-Holiday.ics
```

File output:

```json
{
  "VCALENDAR": [
    {
      "PRODID": "-//Calendar Labs//Calendar 1.0//EN",
      "VERSION": "2.0",
      "CALSCALE": "GREGORIAN",
      "METHOD": "PUBLISH",
      "X-WR-CALNAME": "Usa Holidays",
      "X-WR-TIMEZONE": "America/New_York",
      "VEVENT": [
        {
          "CREATED": "20111213T123901Z",
          "DESCRIPTION": "Visit http://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day.",
          "DTEND": {
            "VALUE": "DATE",
            "_": "20130102"
          },
          "DTSTAMP": "20111213T124028Z",
          "DTSTART": {
            "VALUE": "DATE",
            "_": "20130101"
          },
          "LAST-MODIFIED": "20111213T123901Z",
          "LOCATION": "",
          "SEQUENCE": "0",
          "STATUS": "CONFIRMED",
          "SUMMARY": "New Year's Day",
          "TRANSP": "TRANSPARENT",
          "UID": "9d6fa48343f70300fe3109efe@calendarlabs.com"
        }
      ]
    }
  ]
}
```

Properties with parameters (e.g. `DTSTART;VALUE=DATE`) are represented as objects where parameters become keys and the value is stored under `_`.

## CLI

```
Usage: ical2json [options] [FILES...]

Options:
  -V, --version            output the version number
  -o, --output-dir <path>  Output directory
  -r, --revert             Revert JSON to ical
  -s, --stdout             Output to stdout
  -h, --help               display help for command
```

## Programmatic API

```js
import { convert, revert } from "ical2json";

// convert(icalString: string): IcalObject — parse ical text into JSON
const output = convert(icalData);

// revert(json: IcalObject): string — serialize JSON back to ical text
const icalOutput = revert(output);
```

---
_Source: https://npm.io/package/ical2json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
