The development of a universal fault-tolerant quantum computer that can solve efficiently various difficult computational problems is an outstanding challenge for science and technology. In this work, we propose a technique for an efficient implementation of quantum algorithms with multilevel quantum systems (qudits). Our method uses a transpilation of a circuit in the standard qubit form, which depends on the characteristics of a qudit-based processor, such as the number of available qudits and the number of accessible levels. This approach provides a qubit-to-qudit mapping and comparison to a standard realization of quantum algorithms highlighting potential advantages of qudits. We provide an explicit scheme of transpiling qubit circuits into sequences of single-qudit and two-qudit gates taken from a particular universal set. We then illustrate our method by considering an example of an efficient implementation of a 6-qubit quantum algorithm with qudits. In this particular example, we demonstrate how using qudits allows a decreasing amount of two-body interactions in the qubit circuit implementation. We expect that our findings are of relevance for ongoing experiments with noisy intermediate-scale quantum devices that operate with information carriers allowing qudit encodings, such as trapped ions and neutral atoms, as well as optical and solid-state systems.