Within a few years, any American with a computer may be able to file a tax return from home, getting a refund three weeks sooner or paying any balance due with a credit card.

Until the bugs are worked out, most taxpayers will have to stick with the old-fashioned way of filing -- paper returns mailed to the Internal Revenue Service. But an increasing number will be able to use a system by which accountants and other professional preparers file returns to the IRS electronically.

The IRS this week announced the 2-year-old electronic-filing program will be expanded next year to professionals in all or part of 14 states and made available to as many as 30 million couples and individuals.

Judging by the first two years, it is unlikely that anywhere near that many taxpayers will file electronically in 1988 because there is no indication that a sufficient number of professionals will take part. In 1986, the first year of the program, only a handful of firms took part and filed about 25,000 returns electronically. This year, more than 60 firms filed about 80,000 returns by this method.

During the first year of the project, electronic filing was available in parts of three states. This year, the program spread to four more areas.

Under the electronic system, an accountant or tax preparer calculates a person's tax liability and transmits the information to the IRS via telephone line. The taxpayer's signature is obtained on a separate sheet. At the taxpayer's option, refunds may be deposited directly into their checking or savings account, wiping out more paperwork.

The process eliminates a considerable amount of manual processing at the IRS service center and reduces errors and the need for information storage, saving the government an estimated $200 million over the next 10 years.

For the moment, electronic filing is available only to couples and individuals who are getting a tax refund, and the return must be prepared by a professional, who charges a filing fee in addition to the regular preparation fee. About 80 percent of returns call for refunds.

The IRS said its technicians are exploring ways for:"Expansion . . . to 'balance-due' returns under a system permitting a taxpayer to pay by means of a credit card." This would require action by Congress. "Development of compatible software and a secure system of transmission . . . that would enable home-computer owners to file electronically without relying on a tax preparer for transmission."

About half of all individual returns are prepared by professionals, and one-third of those are done on computer, then filed by mail.

Professional preparers throughout Alabama, Arizona, Indiana, Kentucky, Nebraska, North Carolina, Utah, Virginia, Washington and Wisconsin will be offering electronic filing next year, along with those operating out of offices in areas served by IRS districts in Albany and Buffalo, N.Y.; Cincinnati; Sacramento and San Jose, Calif., and Dallas.