Composer JSON Generator
Fill in your package details, add dependencies, configure autoloading and scripts, then download a ready-to-use composer.json file.
Use the Composer JSON Generator
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
The Composer JSON Generator lets you build a valid composer.json file for any PHP project without writing JSON by hand. Configure your vendor/package name, license, PHP version constraint, required packages, PSR-4 autoload namespaces, and custom Composer scripts, then copy or download the result instantly.
How it works
- Enter your package name in vendor/package format (e.g. acme/my-app).
- Set a description, license, and minimum PHP version.
- Add dependencies by typing the package name and version constraint.
- Configure a PSR-4 autoload namespace and source directory.
- Add optional Composer scripts such as test or lint commands.
- 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-05-23 · Reviewed by Nham Vu