Both.
It's a constitutional federal republic, which is a representative democracy.
And, it ain't perfect.
What is a representative democracy?
According to USA government, America is a representative democracy: citizens vote for their elected officials to represent the citizens’ ideas and concerns in government.
Citizens can also contact their officials when they want to support or change a law.
Why do some folks say the USA is not a democracy?
From what I can find, they either accidentally or intentionally misrepresent info.
They often seem to mean one of two things:
That the USA is not a direct/pure democracy open_in_new, though no one appears to be legitimately arguing that it is. It's a representative/indirect democracy, where instead of voting on every government decision (direct), citizens elect representatives to vote on their behalf (indirect). Whether moving toward a more direct democracy would give Americans more liberty open_in_new is often an honest debate. But, pretending that direct democracy is the only form seems rather dubious, no?
That the presidential election is not a popular vote open_in_new, unlike all other USA elections. A sound sounding argument is that the electoral college open_in_new has effectively disenfranchised much of the USA through gerrymandering open_in_new and further voter suppression open_in_new. From what I understand, this would make its democracy imperfect and flawed, but neither non-existant nor necessarily unimproving. At least, not yet.
Note: Even if the USA did have a direct, popular vote for president, it still would not be a direct democracy. A popularly elected president, like all other elected officials, makes decisions unreliant on citizens' votes (in other words, they represent the citizens who elected them in a representative democracy).
I feel some make interesting points worth critically considering, yet every author apparently relies their conclusion on multiple strawman logical fallacies open_in_new (among others) such as confusing both indirect democracy, and a popular presidential vote, with direct democracy:
America Is a Republic, Not a Democracy open_in_new from The Heritage Foundation
Democracy or Liberty? open_in_new from CATO Institute
The United States Is Not a Democracy. open_in_new from Zinn Education Project
More info & context
Here's how a variety of other people have come to a similar conclusion: it ain't just me over here!
Democracy or Republic: What's the difference? open_in_new from Merriam-Webster
Is the United States a Democracy or a Republic? open_in_new from RepresentUs
Is America a democracy or a republic? Yes, it is open_in_new from NPR
What Type of Government Is the United States of America? open_in_new from Mormon Women for Ethical Government