Federal Reserve Chairwoman Janet Yellen said Thursday there could be benefits to allowing the central bank to buy stocks as a way to boost the economy in a downturn.

Speaking to a minority bankers’ conference at the Kansas City Fed via videoconference, Ms. Yellen said stock-buying could be a tool for policy makers in the future.

“There could be benefits to the ability to buy either equities or corporate bonds,” she said in reply to a question from the audience. “There would also be costs as well that would have to be carefully considered in deciding whether that would be a good idea.”

The Fed doesn’t have legal authority to buy stocks. After the financial crisis, it bought Treasurys and mortgage-backed securities to push down long-term yields to encourage borrowing, spending, hiring and investment.

In an appearance before the House Financial Services Committee on Wednesday, Ms. Yellen said the Fed wouldn’t be able to buy equities unless Congress changed the law.