How to compare two stocks with AI

Last updated August 2026

Short answer

The failure mode is asking for two summaries and treating them as a comparison. They will use different periods, different definitions and different sources, and the result will look rigorous while comparing nothing. Fix the terms first: same period, same metrics, figures from the filings, and a request for the assumptions rather than a verdict.

A comparison is only as good as the thing being held constant, which is the part that gets skipped when the output arrives already formatted as a table.

Fix the terms first

Name the period explicitly, and use the same one for both companies, including the same fiscal year ends where they differ.

Name the metrics, so that both are measured the same way rather than each being described in the way that flatters it.

Name the source, which should be the filings, so the figures can be traced rather than trusted.

What is worth comparing

Revenue growth, and whether it came from volume, price or acquisitions, which are three different things wearing one number.

Margins over several years, since the direction says more than the level.

Operating cash flow against net income, debt and its maturities, and diluted share count over time.

Where comparisons mislead

Across sectors, where structural differences in margin and multiple dominate anything specific to the companies.

Across the cycle, where a cyclical business looks cheapest at peak earnings and most expensive at the bottom.

Between adjusted figures, where each company chooses what to exclude and the two definitions are not the same.

Try it in Walnut

Walnut connects to your brokerage, so a comparison can include what you already hold rather than treating the two companies in isolation.

Ask for assumptions rather than verdicts

A request for which to buy produces a confident answer with its reasoning compressed out of sight.

Asking what would have to be true for each to be the better holding surfaces the assumptions where you can evaluate them.

That reframing turns the output into something you can disagree with, which is the only form of analysis worth having.

Include your own portfolio

If you already own one of the two, adding the other may concentrate a sector bet rather than diversifying it.

The relevant question becomes what each adds to what you hold, not which is better in isolation.

That is a portfolio question, and it usually matters more than the difference between two reasonable companies.

A prompt that works

Compare these two companies using their latest 10-K filings only, for the same fiscal period, on revenue growth, gross and operating margin, operating cash flow against net income, total debt and maturity schedule, and diluted share count over five years.

Cite the section and page for every figure, and flag anything you could not find rather than estimating it.

Then tell me what would have to be true about the next five years for each one to be the better holding.

Reading the output

Check two or three figures against the filings before reading the conclusions, because an error in the inputs invalidates everything downstream.

Look for anything flagged as unavailable, since a gap in the data is more informative than a smoothly complete table.

Treat the assumptions as the output. The table is the working, and the assumptions are the thing you are actually being asked to agree or disagree with.

Sources

Filings for both companies are available through EDGAR full-text search, and SEC guidance on non-GAAP measures is published in its compliance and disclosure interpretations. Walnut is informational and is not an investment adviser. This guide is educational and not personalized investment advice.

FAQ

How do I compare two stocks properly?

+

Fix the terms before asking: the same period, the same metrics, and figures drawn from the filings rather than from memory. Two summaries written independently will use different periods and different definitions, and they will not be comparable.

Which metrics are worth comparing?

+

Revenue growth and its composition, gross and operating margins, operating cash flow against net income, debt and its maturity schedule, and share count over time. Valuation multiples come after those, not instead of them.

Does comparing across sectors work?

+

Poorly. A software company and a utility have structurally different margins and multiples, and the comparison mostly measures the sector. Within a peer group the same figures become informative.

What about adjusted earnings?

+

Two companies can adjust for different things, so comparing adjusted figures compares two different definitions. Ask for the reconciliation to standard figures and compare those instead.

Should I ask which one to buy?

+

You will get an answer and it will be confident. A more useful request is what would have to be true for each to be the better holding, which surfaces the assumptions rather than hiding them inside a verdict.

How do I check the numbers?

+

Ask for the source of each figure and open it. Anything material should trace to a line in a filing, and anything that cannot be traced should be treated as a prompt to look rather than as information.

Does past performance belong in the comparison?

+

As context rather than as evidence. A stock that outperformed over five years may have done so because expectations rose, which affects what you are paying now rather than what the business will do next.

What if I already own one of them?

+

Then the useful comparison includes your existing exposure. Adding the second may increase a sector bet you already hold, which is a portfolio question rather than a question about either company.

What does a good prompt look like?

+

One that fixes the terms: same fiscal period, named metrics, filings as the only source, a citation for every figure, and an instruction to flag anything it could not find rather than estimating. Then ask what would have to be true for each to be the better holding.

Related guides

    How to compare two stocks with AI - Walnut AI Investing App