Composer JSON Generator

Fill in your package details, add dependencies, configure autoloading and scripts, then download a ready-to-use composer.json file.

Package Info

Dependencies

Leave empty to generate without dependencies.

PSR-4 Autoload

Scripts

composer.json
{
  "name": "vendor/package-name",
  "description": "",
  "type": "project",
  "license": "MIT",
  "require": {
    "php": ">=8.1"
  }
}

Quick-start

After downloading, run composer install in the same directory to fetch dependencies and set up autoloading.

Copied!

Summary

Fill in your package details, add dependencies, configure autoloading and scripts, then download a ready-to-use composer.json file.

How it works

  1. Enter your package name in vendor/package format (e.g. acme/my-app).
  2. Set a description, license, and minimum PHP version.
  3. Add dependencies by typing the package name and version constraint.
  4. Configure a PSR-4 autoload namespace and source directory.
  5. Add optional Composer scripts such as test or lint commands.
  6. Click Generate — preview the JSON and copy or download the file.

Use cases

  • Bootstrap a new PHP library or application quickly.
  • Generate a correct composer.json template when starting a project from scratch.
  • Learn the proper structure of composer.json without reading full documentation.
  • Add or validate version constraints before editing a real project file.
  • Set up PSR-4 autoloading for a custom namespace in seconds.
  • Create reproducible project scaffolding for team onboarding.

Frequently Asked Questions

Last updated: 2026-06-09 · Reviewed by Nham Vu