Skip to main content

LTspice to SVG Converter

Overview

This tool translates LTspice (https://www.analog.com/en/resources/design-tools-and-calculators/ltspice-simulator.html) circuit schematics (.asc files) into publication-grade SVG graphics. I created it because I was tired of redrawing circuits in Visio, Illustrator, or PowerPoint for documentation purposes. While these are powerful drawing tools, none of them are as fast or convenient as a dedicated schematic capture tool. This converter was born out of the necessity to generate clean, high-quality schematics that look better than screenshots.

The tool parses all the shapes, components, wires, and texts in an LTspice schematic and renders them into a structured SVG file. It automatically searches for the symbol definition files (.asy) and correctly renders them with proper orientation and mirroring.

This will convert a schematic like this:

LTspice Miller OTA Schematic

into an SVG file like this:

Miller OTA SVG Output

Note: the IO pins are rendered with text outside of the pin shapes, which is an intentional design decision.

The output SVG is perfect for:

  • Publication-quality documentation
  • Web integration with perfect scaling
  • Further editing in vector graphics software
  • Professional presentations and reports

You get full control over the rendering through comprehensive command-line options (see the Usage section below).

Installation

Option 1: Install from PyPI (Recommended for stable releases)

pip install ltspice-to-svg

After installation, you can use the command-line tool from anywhere:

ltspice_to_svg your_schematic.asc

Option 2: Install from GitHub (For latest development version)

If you want the latest features and changes that haven't been released to PyPI yet:

pip install git+https://github.com/Jianxun/ltspice_to_svg.git

Option 3: Clone the repository and install

  1. Clone the repository:
git clone https://github.com/Jianxun/ltspice_to_svg.git
cd ltspice_to_svg
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install as a development package:
pip install -e .

Usage

Using the command-line tool (after pip installation)

ltspice_to_svg your_schematic.asc

This will generate your_schematic.svg in the same directory as your schematic file.

Command Line Options

Basic Options

  • --stroke-width: Width of lines in the SVG (default: 2.0)
  • --dot-size: Size of junction dots relative to stroke width (default: 1.5)
  • --base-font-size: Base font size in pixels (default: 16.0)
  • --margin: Margin around schematic elements as percentage of viewbox (default: 10.0, can be set to 0 for tight fit)
  • --font-family: Font family for text elements (default: Arial)

Text Rendering Options

  • --no-text: Master switch to disable ALL text rendering
  • --no-schematic-comment: Skip rendering schematic comments
  • --no-spice-directive: Skip rendering SPICE directives
  • --no-nested-symbol-text: Skip rendering text inside symbols
  • --no-component-name: Skip rendering component names (R1, C1, etc.)
  • --no-component-value: Skip rendering component values (10k, 1uF, etc.)
  • --no-net-label: Skip rendering net label flags
  • --no-pin-name: Skip rendering I/O pin text while keeping the pin shapes

File Options

  • --export-json: Export intermediate JSON files for debugging
  • --ltspice-lib: Path to LTspice symbol library (overrides system default)

Post-Processing in Vector Graphics Editors

One of the advantages of generating SVG files is the ability to further refine them in vector graphics editors. The SVGs produced by this tool are structured logically with groups for different element types, making them easy to work with in editors like:

  • Adobe Illustrator: Professional industry standard
  • Inkscape: Powerful free and open-source alternative

Example Commands

# Basic conversion
ltspice_to_svg myschematic.asc

# Control visual style
ltspice_to_svg myschematic.asc --stroke-width 3.0 --dot-size 2.0

# Adjust margins around schematic
ltspice_to_svg myschematic.asc --margin 5.0  # 5% margin for tighter fit
ltspice_to_svg myschematic.asc --margin 0.0  # No margin for exact bounds

# Change font family
ltspice_to_svg myschematic.asc --font-family "Helvetica"
ltspice_to_svg myschematic.asc --font-family "Courier New"  # For monospace text

# Disable certain text elements
ltspice_to_svg myschematic.asc --no-schematic-comment --no-net-label

# For documentation with just components and wires
ltspice_to_svg myschematic.asc --no-text

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run the tests to ensure everything works (python -m pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Please make sure your code follows the existing style and includes appropriate tests for new features.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for ltspice-to-svg 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ltspice-to-svg 0.2.0
File Size Uploaded
ltspice_to_svg-0.2.0.tar.gz 53.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ltspice-to-svg 0.2.0
File Interpreter ABI Platform
ltspice_to_svg-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 96.9 kB

Release files / ltspice_to_svg-0.2.0.tar.gz

Download URL ltspice_to_svg-0.2.0.tar.gz
Size 53.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2a1a08bce9597b63866d6d50c9f5a304628f9615d4d66ea0b3dac2802373b500
BLAKE2b-256 checksum
How to use checksums
999bb6f38eed610a577a3b14e83f589e66934a3e05328df53a67d7688f25a0be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2025.

Transparency log

Release files / ltspice_to_svg-0.2.0-py3-none-any.whl

Download URL ltspice_to_svg-0.2.0-py3-none-any.whl
Size 43.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
002ed9727f55aab684bfde2bed8889c586f37021c5de1cae644656a452c4d91c
BLAKE2b-256 checksum
How to use checksums
347c68b9539dbb178ce2b05fef151ab0527b2c35010642e36c43de638ddc3be4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page